mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
InstCombine: fold fcmp pred (fneg x), C -> fcmp swap(pred) x, -C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2834,6 +2834,14 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
|
||||
return SelectInst::Create(LHSI->getOperand(0), Op1, Op2);
|
||||
break;
|
||||
}
|
||||
case Instruction::FSub: {
|
||||
// fcmp pred (fneg x), C -> fcmp swap(pred) x, -C
|
||||
Value *Op;
|
||||
if (match(LHSI, m_FNeg(m_Value(Op))))
|
||||
return new FCmpInst(I.getSwappedPredicate(), Op,
|
||||
ConstantExpr::getFNeg(RHSC));
|
||||
break;
|
||||
}
|
||||
case Instruction::Load:
|
||||
if (GetElementPtrInst *GEP =
|
||||
dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) {
|
||||
|
||||
Reference in New Issue
Block a user