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:
f8a447d
)
make reassociate more careful about not leaving around dead mul's
author
Chris Lattner
<sabre@nondot.org>
Thu, 31 Dec 2009 19:34:45 +0000
(19:34 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Thu, 31 Dec 2009 19:34:45 +0000
(19:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92370
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/Reassociate.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/Reassociate.cpp
b/lib/Transforms/Scalar/Reassociate.cpp
index 8596dc70dadcca1516d5626076bbbbe5e1822cff..365c9f795829001b426b62505dd77975508168db 100644
(file)
--- a/
lib/Transforms/Scalar/Reassociate.cpp
+++ b/
lib/Transforms/Scalar/Reassociate.cpp
@@
-530,7
+530,13
@@
Value *Reassociate::RemoveFactorFromExpression(Value *V, Value *Factor) {
return 0;
}
- if (Factors.size() == 1) return Factors[0].Op;
+ // If this was just a single multiply, remove the multiply and return the only
+ // remaining operand.
+ if (Factors.size() == 1) {
+ ValueRankMap.erase(BO);
+ BO->eraseFromParent();
+ return Factors[0].Op;
+ }
RewriteExprTree(BO, Factors);
return BO;