aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-08 16:34:13 +0000
committerChris Lattner <sabre@nondot.org>2004-10-08 16:34:13 +0000
commitd04cd5579606dd93950d521786b478ffab1099c6 (patch)
treed39eadb0a3ad1a53e646c17d90a4a1f4765334cb
parentd4bcae9031cbd7c6e908569bdbd137ac3406b4c9 (diff)
Fix bug: 2004-10-08-SelectSetCCFold.llx. Normally this is hidden by the
instcombine xform, which is why we didn't notice it before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16840 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86ISelSimple.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp
index 71607b4ad8..ff0ba75918 100644
--- a/lib/Target/X86/X86ISelSimple.cpp
+++ b/lib/Target/X86/X86ISelSimple.cpp
@@ -847,7 +847,8 @@ static SetCondInst *canFoldSetCCIntoBranchOrSelect(Value *V) {
if ((isa<BranchInst>(User) || isa<SelectInst>(User)) &&
(getClassB(SCI->getOperand(0)->getType()) != cLong ||
SCI->getOpcode() == Instruction::SetEQ ||
- SCI->getOpcode() == Instruction::SetNE))
+ SCI->getOpcode() == Instruction::SetNE) &&
+ User->getOperand(0) == V)
return SCI;
}
return 0;