[InstCombine] Fix PR24605.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 28 Aug 2015 19:09:31 +0000 (19:09 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 28 Aug 2015 19:09:31 +0000 (19:09 +0000)
commitc93f771c2f8ef8795609e70340b566829925f5b2
tree24936246a147064f7e4fd81062f45321aaa73af9
parent55189b7fcaa03fc2e8ff04a58a58cdb653d0ab91
[InstCombine] Fix PR24605.

PR24605 is caused due to an incorrect insert point in instcombine's IR
builder.  When simplifying

  %t = add X Y
  ...
  %m = icmp ... %t

the replacement for %t should be placed before %t, not before %m, as
there could be a use of %t between %t and %m.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246315 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
lib/Transforms/InstCombine/InstCombineInternal.h
test/Transforms/InstCombine/pr24605.ll [new file with mode: 0644]