InstCombine: Fix another infinite loop caused by visitFPTrunc
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 18 Nov 2014 22:06:45 +0000 (22:06 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 18 Nov 2014 22:06:45 +0000 (22:06 +0000)
commit643bef9333fddccab13d91e342e8ea7c6009c985
treed8b641a33d9dadcf95ab6da81c32d1079be0f1e5
parented37b1e2d0c41005b0e0ff03bb16c7acf932ef05
InstCombine: Fix another infinite loop caused by visitFPTrunc

We would attempt to replace an frem's operand with the same operand.
This would cause InstCombine to think real work was done, causing
InstCombine to enter an infinite loop.

This fixes the second part of PR21576.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222265 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp
test/Transforms/InstCombine/fpcast.ll