When marking a block as being unanalyzable, use "Clobber" on the terminator instead...
authorEli Friedman <eli.friedman@gmail.com>
Thu, 2 Jun 2011 00:08:52 +0000 (00:08 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 2 Jun 2011 00:08:52 +0000 (00:08 +0000)
commit7c6a5a2c397bb3759ed5df80a2ff9a4fdf17675a
tree3b1af1d3fe30f884046c80f873c701647b6244e5
parent11772e093f159a37d92fe5855faa89ad70b1639d
When marking a block as being unanalyzable, use "Clobber" on the terminator instead of the first instruction in the block.  This is a bit of a hack; "Clobber" isn't really the right marking in the first place.  memdep doesn't really have any way of properly expressing "unanalyzable" at the moment.  Using it on the terminator is much less ambiguous than using it on an arbitrary instruction, though.

In the given testcase, the "Clobber" was pointing to a load, and GVN was incorrectly assuming that meant that the "Clobber" load overlapped the load being analyzed (when they are actually unrelated).

The included testcase tests both this commit and r132434.

Part two of rdar://9429882.  (r132434 was mislabeled.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132442 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/MemoryDependenceAnalysis.cpp
test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll [new file with mode: 0644]