GVN: don't try to replace instruction with itself.
authorTim Northover <tnorthover@apple.com>
Fri, 23 Oct 2015 20:30:02 +0000 (20:30 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 23 Oct 2015 20:30:02 +0000 (20:30 +0000)
commitbd7189d76c58fb03733058d6ea65745e54c7233a
tree8ab3c49870890ea23945714c946c33b3e7f53196
parent89cb1b78f95df1f2c999db46282e41fce8dd46ca
GVN: don't try to replace instruction with itself.

After some look-ahead PRE was added for GEPs, an instruction could end
up in the table of candidates before it was actually inspected. When
this happened the pass might decide it was the best candidate to
replace itself. This didn't go well.

Should fix PR25291

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251145 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/GVN.cpp
test/Transforms/GVN/pre-gep-load.ll