InstCombine: Fix transform to use the swapped predicate.

Thanks Frits!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128628 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2011-03-31 10:46:03 +00:00
parent 68b4bd0a63
commit 00e00d693c
2 changed files with 3 additions and 3 deletions

View File

@ -2855,10 +2855,10 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
}
}
// fcmp (fneg x), (fneg y) -> fcmp x, y
// fcmp pred (fneg x), (fneg y) -> fcmp swap(pred) x, y
Value *X, *Y;
if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_FNeg(m_Value(Y))))
return new FCmpInst(I.getPredicate(), X, Y);
return new FCmpInst(I.getSwappedPredicate(), X, Y);
// fcmp (fpext x), (fpext y) -> fcmp x, y
if (FPExtInst *LHSExt = dyn_cast<FPExtInst>(Op0))