From 4f4eecf0ec56a15b3dc377cac3799463cbf77a1f Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Sat, 29 Aug 2020 14:44:16 +0300 Subject: [PATCH] [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. --- llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp index b63e7bf..448b14e 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -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; } } -- 2.7.4