summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-11 01:39:19 +0000
committerChris Lattner <sabre@nondot.org>2004-04-11 01:39:19 +0000
commit24cf0200c71976c5b72334f7cf968d72f7172e12 (patch)
tree0e46a58e92a1f6415bf8c5e9d97106fa0de79c70 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent192e326cd3d3cb43256a62c7b42fc67191bedde0 (diff)
downloadbcm5719-llvm-24cf0200c71976c5b72334f7cf968d72f7172e12.tar.gz
bcm5719-llvm-24cf0200c71976c5b72334f7cf968d72f7172e12.zip
Fix a bug in my select transformation
llvm-svn: 12826
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 56c52b3fb81..af85c5fdde9 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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.
}
}
OpenPOWER on IntegriCloud