Revert "r223364 - Revert r223347 which has caused crashes on bootstrap bots."
authorHal Finkel <hfinkel@anl.gov>
Thu, 4 Dec 2014 17:45:19 +0000 (17:45 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 4 Dec 2014 17:45:19 +0000 (17:45 +0000)
commitefbb95a1be0a6acf344d9d4f1c285da051e939fc
treec45b69f4a158dbee935ef9d28e79083e9322c4f8
parentad90e3ad14488b9b78d2ac4dd39f02ce2e35f264
Revert "r223364 - Revert r223347 which has caused crashes on bootstrap bots."

Reapply r223347, with a fix to not crash on uninserted instructions (or more
precisely, instructions in uninserted blocks). bugpoint was able to reduce the
test case somewhat, but it is still somewhat large (and relies on setting
things up to be simplified during inlining), so I've not included it here.
Nevertheless, it is clear what is going on and why.

Original commit message:

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@223371 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/noalias-ptr.ll