[NFC][InstCombine] Fix some comments: the code already uses IC::replaceInstUsesWith()

This commit is contained in:
Roman Lebedev 2020-08-29 14:54:08 +03:00
parent 65b3854e10
commit bd12113f57
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 2 additions and 2 deletions

View File

@ -1900,7 +1900,7 @@ Instruction *InstCombinerImpl::visitCallBase(CallBase &Call) {
!CalleeF->isDeclaration()) {
Instruction *OldCall = &Call;
CreateNonTerminatorUnreachable(OldCall);
// If OldCall does not return void then replaceAllUsesWith undef.
// If OldCall does not return void then replaceInstUsesWith undef.
// This allows ValueHandlers and custom metadata to adjust itself.
if (!OldCall->getType()->isVoidTy())
replaceInstUsesWith(*OldCall, UndefValue::get(OldCall->getType()));
@ -1919,7 +1919,7 @@ Instruction *InstCombinerImpl::visitCallBase(CallBase &Call) {
if ((isa<ConstantPointerNull>(Callee) &&
!NullPointerIsDefined(Call.getFunction())) ||
isa<UndefValue>(Callee)) {
// If Call does not return void then replaceAllUsesWith undef.
// If Call does not return void then replaceInstUsesWith undef.
// This allows ValueHandlers and custom metadata to adjust itself.
if (!Call.getType()->isVoidTy())
replaceInstUsesWith(Call, UndefValue::get(Call.getType()));