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

llvm-svn: 19555
This commit is contained in:
Chris Lattner 2005-01-14 19:31:00 +00:00
parent 57fb55d750
commit c3ed31f837
1 changed files with 2 additions and 1 deletions

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;
}