mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-09 16:45:03 +00:00
Implement: -A*-B == A*B
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5740 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
533741a764
commit
a4f445b28c
@ -342,6 +342,10 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Value *Op0v = dyn_castNegVal(Op0)) // -X * -Y = X*Y
|
||||
if (Value *Op1v = dyn_castNegVal(I.getOperand(1)))
|
||||
return BinaryOperator::create(Instruction::Mul, Op0v, Op1v);
|
||||
|
||||
return Changed ? &I : 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user