From 71ac9105cd392a257d15515579c70f06c970c5cb Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Sat, 29 Aug 2020 15:04:07 +0300 Subject: [PATCH] [InstCombine] foldAggregateConstructionIntoAggregateReuse(): use InstCombiner::replaceInstUsesWith() instead of RAUW We really shouldn't use RAUW in InstCombine because we should consistently update Worklist to avoid extra iterations. --- llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 5cd1822..14de00f 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -975,7 +975,7 @@ Instruction *InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse( PHI->addIncoming(SourceAggregates[Pred], Pred); ++NumAggregateReconstructionsSimplified; - OrigIVI.replaceAllUsesWith(PHI); + replaceInstUsesWith(OrigIVI, PHI); // Just signal that the fold happened, we've already inserted instructions. return &OrigIVI; -- 2.7.4