forked from OSchip/llvm-project
[InstCombine][NFC]Use only `replaceInstUsesWith`, NFC.
This commit is contained in:
parent
82563d8d14
commit
8af69975af
|
@ -1905,10 +1905,8 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
|
|||
unsigned IdxN = cast<ConstantInt>(Idx)->getZExtValue();
|
||||
|
||||
// An insert that entirely overwrites Vec with SubVec is a nop.
|
||||
if (VecNumElts == SubVecNumElts) {
|
||||
replaceInstUsesWith(CI, SubVec);
|
||||
return eraseInstFromFunction(CI);
|
||||
}
|
||||
if (VecNumElts == SubVecNumElts)
|
||||
return replaceInstUsesWith(CI, SubVec);
|
||||
|
||||
// Widen SubVec into a vector of the same width as Vec, since
|
||||
// shufflevector requires the two input vectors to be the same width.
|
||||
|
@ -1932,8 +1930,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
|
|||
Mask.push_back(i);
|
||||
|
||||
Value *Shuffle = Builder.CreateShuffleVector(Vec, WidenShuffle, Mask);
|
||||
replaceInstUsesWith(CI, Shuffle);
|
||||
return eraseInstFromFunction(CI);
|
||||
return replaceInstUsesWith(CI, Shuffle);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1962,8 +1959,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
|
|||
Mask.push_back(IdxN + i);
|
||||
|
||||
Value *Shuffle = Builder.CreateShuffleVector(Vec, Mask);
|
||||
replaceInstUsesWith(CI, Shuffle);
|
||||
return eraseInstFromFunction(CI);
|
||||
return replaceInstUsesWith(CI, Shuffle);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1990,8 +1986,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
|
|||
"Expected or reduction.");
|
||||
Res = Builder.CreateIsNotNull(Res);
|
||||
}
|
||||
replaceInstUsesWith(CI, Res);
|
||||
return eraseInstFromFunction(CI);
|
||||
return replaceInstUsesWith(CI, Res);
|
||||
}
|
||||
LLVM_FALLTHROUGH;
|
||||
}
|
||||
|
@ -2016,8 +2011,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
|
|||
if (Arg != Vect &&
|
||||
cast<Instruction>(Arg)->getOpcode() == Instruction::SExt)
|
||||
Res = Builder.CreateNeg(Res);
|
||||
replaceInstUsesWith(CI, Res);
|
||||
return eraseInstFromFunction(CI);
|
||||
return replaceInstUsesWith(CI, Res);;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue