summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-04-13 20:39:37 +0000
committerCraig Topper <craig.topper@gmail.com>2017-04-13 20:39:37 +0000
commite953dec673b6f2ec1e81445c16d799e29f4f76b2 (patch)
tree65ccc5919a3a1f2a46ff1fad9a22182be51ee98d
parentaf36d02430d66212c6bcab713199f2ab74c03a16 (diff)
downloadbcm5719-llvm-e953dec673b6f2ec1e81445c16d799e29f4f76b2.tar.gz
bcm5719-llvm-e953dec673b6f2ec1e81445c16d799e29f4f76b2.zip
[ValueTracking] Remove duplicate call to computeKnownBits for the operands of Select.
We call it unconditionally on the operands of the select. Then decide if its a min/max and call it on the min/max operands or on the select operands again. Either of those second calls will overwrite the results of the initial call so we can just delete the first call. llvm-svn: 300256
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index c72a3f63d05..3f8f6457480 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -976,11 +976,7 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero,
break;
}
case Instruction::Select: {
- computeKnownBits(I->getOperand(2), KnownZero, KnownOne, Depth + 1, Q);
- computeKnownBits(I->getOperand(1), KnownZero2, KnownOne2, Depth + 1, Q);
-
- const Value *LHS;
- const Value *RHS;
+ const Value *LHS, *RHS;
SelectPatternFlavor SPF = matchSelectPattern(I, LHS, RHS).Flavor;
if (SelectPatternResult::isMinOrMax(SPF)) {
computeKnownBits(RHS, KnownZero, KnownOne, Depth + 1, Q);
OpenPOWER on IntegriCloud