diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-11 01:39:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-11 01:39:19 +0000 |
commit | fbede52af457f4278133c22c653c9f93ffcda975 (patch) | |
tree | 97f99ccf23c1633bb63d18c9d235cf5c84ec429c /lib | |
parent | a0ae8196a1d2d1291949e268afc1bf932c9f8028 (diff) | |
download | external_llvm-fbede52af457f4278133c22c653c9f93ffcda975.zip external_llvm-fbede52af457f4278133c22c653c9f93ffcda975.tar.gz external_llvm-fbede52af457f4278133c22c653c9f93ffcda975.tar.bz2 |
Fix a bug in my select transformation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 56c52b3..af85c5f 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. } } |