Restrict somewhat the memory-allocation pointer cmp opt from r223093
authorHal Finkel <hfinkel@anl.gov>
Thu, 4 Dec 2014 09:22:28 +0000 (09:22 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 4 Dec 2014 09:22:28 +0000 (09:22 +0000)
commitd70d5148a64ae9b3685275f8842daa361ec8866f
tree74283d5714132b9e78c0f91f23ed9ee68b9b14d4
parent9ce01153e084e1232a7e440ac3c3022c3a54ca6d
Restrict somewhat the memory-allocation pointer cmp opt from r223093

Based on review comments from Richard Smith, restrict this optimization from
applying to globals that might resolve lazily to other dynamically-loaded
modules, and also from dynamic allocas (which might be transformed into malloc
calls). In short, take extra care that the compared-to pointer is really
simultaneously live with the memory allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223347 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/noalias-ptr.ll