summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-11-18 20:15:36 +0000
committerDuncan Sands <baldrick@free.fr>2012-11-18 20:15:36 +0000
commit820b52572fadeb8c5a61b023022974372e5ce418 (patch)
treef6336f34935c0c19ef6a07e0dbc1f839feb88b22 /lib/Transforms/Scalar/Reassociate.cpp
parentb8e1111fbf71766903d2fc7b158dc612df097ea3 (diff)
downloadllvm-820b52572fadeb8c5a61b023022974372e5ce418.tar.gz
llvm-820b52572fadeb8c5a61b023022974372e5ce418.tar.bz2
llvm-820b52572fadeb8c5a61b023022974372e5ce418.tar.xz
Remove the last bit of constant folding from LinearizeExprTree (most of it was
removed in commit 168035, but I missed this bit). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index 7a4079784b..377c07020d 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -423,10 +423,6 @@ static bool LinearizeExprTree(BinaryOperator *I,
assert(Instruction::isAssociative(Opcode) &&
Instruction::isCommutative(Opcode) &&
"Expected an associative and commutative operation!");
- // If we see an absorbing element then the entire expression must be equal to
- // it. For example, if this is a multiplication expression and zero occurs as
- // an operand somewhere in it then the result of the expression must be zero.
- Constant *Absorber = ConstantExpr::getBinOpAbsorber(Opcode, I->getType());
// Visit all operands of the expression, keeping track of their weight (the
// number of paths from the expression root to the operand, or if you like
@@ -474,13 +470,6 @@ static bool LinearizeExprTree(BinaryOperator *I,
DEBUG(dbgs() << "OPERAND: " << *Op << " (" << Weight << ")\n");
assert(!Op->use_empty() && "No uses, so how did we get to it?!");
- // If the expression contains an absorbing element then there is no need
- // to analyze it further: it must evaluate to the absorbing element.
- if (Op == Absorber && !Weight.isMinValue()) {
- Ops.push_back(std::make_pair(Absorber, APInt(Bitwidth, 1)));
- return MadeChange;
- }
-
// If this is a binary operation of the right kind with only one use then
// add its operands to the expression.
if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {