[InstCombine] visitPHINode(): use InstCombiner::replaceInstUsesWith() instead of RAUW

As noted in post-commit review, we really shouldn't use RAUW in InstCombine
because we should consistently update Worklist to avoid extra iterations.
This commit is contained in:
Roman Lebedev 2020-08-29 14:44:16 +03:00
parent 3e69871ab5
commit 4f4eecf0ec
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 1 additions and 1 deletions

View File

@ -1439,7 +1439,7 @@ Instruction *InstCombinerImpl::visitPHINode(PHINode &PN) {
continue;
// Just use that PHI instead then.
++NumPHICSEs;
PN.replaceAllUsesWith(&Src);
replaceInstUsesWith(PN, &Src);
return &PN;
}
}