[llvm] 71ac910 - [InstCombine] foldAggregateConstructionIntoAggregateReuse(): use InstCombiner::replaceInstUsesWith() instead of RAUW
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 29 05:11:23 PDT 2020
Author: Roman Lebedev
Date: 2020-08-29T15:10:14+03:00
New Revision: 71ac9105cd392a257d15515579c70f06c970c5cb
URL: https://github.com/llvm/llvm-project/commit/71ac9105cd392a257d15515579c70f06c970c5cb
DIFF: https://github.com/llvm/llvm-project/commit/71ac9105cd392a257d15515579c70f06c970c5cb.diff
LOG: [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.
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 5cd182220a6a..14de00f2e15d 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;
More information about the llvm-commits
mailing list