[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 10:17:47 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);
 
+    // Reserve sufficient buckets to prevent map growth. [1]
+    BBInfos.init(LiveInBlocks.size() + DefBlocks.size());
----------------
vpykhtin wrote:

Sorry, I overlooked your suggestion, I'll use reserve, thanks!

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


More information about the llvm-commits mailing list