mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 19:35:54 +00:00
Fix a bug in my select transformation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12826 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a0ae8196a1
commit
fbede52af4
@ -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.
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user