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)
commit8b24b32c44d77ca3121240a13e0f40cb6d5a766c
tree70b96d9a6edaed06d7fbea0a0aba82ceaf5590b1
parent003fc7f4bbcf18c517c8fbed5b88831d01a224bb
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.

llvm-svn: 223347
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/noalias-ptr.ll