aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 56c52b3fb8..af85c5fdde 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2224,10 +2224,10 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
} else if (SCI->getOperand(0) == FalseVal && SCI->getOperand(1) == TrueVal){
// Transform (X == Y) ? Y : X -> X
if (SCI->getOpcode() == Instruction::SetEQ)
- return ReplaceInstUsesWith(SI, TrueVal);
+ return ReplaceInstUsesWith(SI, FalseVal);
// Transform (X != Y) ? Y : X -> Y
if (SCI->getOpcode() == Instruction::SetNE)
- return ReplaceInstUsesWith(SI, FalseVal);
+ return ReplaceInstUsesWith(SI, TrueVal);
// NOTE: if we wanted to, this is where to detect MIN/MAX/ABS/etc.
}
}