Fix: Regression/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19555 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-01-14 19:31:00 +00:00
parent 557671951f
commit fbd4de1d9b

View File

@ -959,7 +959,8 @@ static SetCondInst *canFoldSetCCIntoBranchOrSelect(Value *V) {
if (SetCondInst *SCI = dyn_cast<SetCondInst>(V))
if (SCI->hasOneUse()) {
Instruction *User = cast<Instruction>(SCI->use_back());
if ((isa<BranchInst>(User) || isa<SelectInst>(User)) &&
if ((isa<BranchInst>(User) ||
(isa<SelectInst>(User) && User->getOperand(0) == V)) &&
SCI->getParent() == User->getParent())
return SCI;
}