projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
533741a
)
Implement: -A*-B == A*B
author
Chris Lattner
<sabre@nondot.org>
Mon, 10 Mar 2003 23:23:04 +0000
(23:23 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Mon, 10 Mar 2003 23:23:04 +0000
(23:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5740
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index 79a551f70c887d83d2fbbb730d414cf11bec711f..067a884bc9d532a00165dc3a2783f02845798324 100644
(file)
--- a/
lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/
lib/Transforms/Scalar/InstructionCombining.cpp
@@
-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;
}