From: Chris Lattner Date: Fri, 8 Oct 2004 22:24:31 +0000 (+0000) Subject: Fix a major regression from the bugfix for 2004-10-08-SelectSetCCFold.llx, X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b0f4e389dba74e5d4692bc42d155950e96c92eaf;p=oota-llvm.git Fix a major regression from the bugfix for 2004-10-08-SelectSetCCFold.llx, which prevented setcc's from being folded into branches. It appears that conditional branchinst's CC operand is actually operand(2), not operand(0) as we might expect. :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16859 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp index ff0ba759183..3b779363e0b 100644 --- a/lib/Target/X86/X86ISelSimple.cpp +++ b/lib/Target/X86/X86ISelSimple.cpp @@ -848,7 +848,7 @@ static SetCondInst *canFoldSetCCIntoBranchOrSelect(Value *V) { (getClassB(SCI->getOperand(0)->getType()) != cLong || SCI->getOpcode() == Instruction::SetEQ || SCI->getOpcode() == Instruction::SetNE) && - User->getOperand(0) == V) + (isa(User) || User->getOperand(0) == V)) return SCI; } return 0;