[llvm] [SSAUpdaterBulk] Fix incorrect live-in values for a block. (PR #131762)

Valery Pykhtin via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 19 08:13:24 PDT 2025


================
@@ -143,34 +136,65 @@ void SSAUpdaterBulk::RewriteAllUses(DominatorTree *DT,
     SmallVector<BasicBlock *, 32> IDFBlocks;
     SmallPtrSet<BasicBlock *, 32> LiveInBlocks;
     ComputeLiveInBlocks(UsingBlocks, DefBlocks, LiveInBlocks, PredCache);
-    IDF.resetLiveInBlocks();
     IDF.setLiveInBlocks(LiveInBlocks);
     IDF.calculate(IDFBlocks);
 
+    // Important: reserve sufficient buckets to prevent map growth. [1]
+    BBInfos.init(LiveInBlocks.size() + DefBlocks.size());
+
+    for (auto [BB, V] : R.Defines)
----------------
vpykhtin wrote:

BB and V are pointers, I don't need a const ref to a pointer

https://github.com/llvm/llvm-project/pull/131762


More information about the llvm-commits mailing list