Fix another infinite loop in InstCombine
authorSteven Wu <stevenwu@apple.com>
Fri, 12 Dec 2014 04:34:07 +0000 (04:34 +0000)
committerSteven Wu <stevenwu@apple.com>
Fri, 12 Dec 2014 04:34:07 +0000 (04:34 +0000)
commita511846bdfafbe5f0a5d1c49fb048472a18ca446
tree162a54fda2ecbcf2ddd41a6b511a1156dc543dec
parent002ca4ca3f0f0e7d4c1a20f0f15843674e6051af
Fix another infinite loop in InstCombine

Summary:
InstCombine infinite-loops for the testcase added
It is because InstCombine is generating instructions that can be
optimized by itself. Fix by not optimizing frem if the optimized
type is the same as original type.
rdar://problem/19150820

Reviewers: majnemer

Differential Revision: http://reviews.llvm.org/D6634

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