1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[InstCombine][NFC]Use only replaceInstUsesWith, NFC.

This commit is contained in:
Alexey Bataev 2021-07-08 13:45:03 -07:00
parent 54e05361bc
commit fc8d16a232

View File

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