[PATCH] D50658: Hot cold splitting pass

Sebastian Pop via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 18 15:35:58 PDT 2018


sebpop added inline comments.


================
Comment at: lib/Transforms/IPO/HotColdSplitting.cpp:275
+    BasicBlock *BB = *I;
+    if (PSI->isColdBB(BB, BFI)) {
+      // Get cold region
----------------
or ColdBlock[BB]


================
Comment at: lib/Transforms/IPO/HotColdSplitting.cpp:277
+      // Get cold region
+      BasicBlock *Exit = PDT[BB]->getIDom()->getBlock();
+      SmallVector<BasicBlock *, 4> Region;
----------------
As Krzysztof mentioned, you need a different code here to get the largest cold region that could contain sequential loops.

You can extend the region as long as SingleExit is cold: then you ask for another exit block that post-dominates Exit, etc. recursively.


================
Comment at: lib/Transforms/IPO/HotColdSplitting.cpp:304
+    if (shouldOutlineFrom(F))
+      outlineColdBlocks(F);
+  }
----------------
you need to pass ColdBlock map to outlineColdBlocks().


https://reviews.llvm.org/D50658





More information about the llvm-commits mailing list