[PATCH] D32249: [PartialInl] Enhance partial inliner to handle more complex conditions

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 14:12:00 PDT 2017


eraman added inline comments.


================
Comment at: lib/Transforms/IPO/PartialInlining.cpp:42
+static cl::opt<unsigned> MaxNumInlineBlocks(
+    "max-num-inline-blocks", cl::init(5), cl::Hidden,
+    cl::desc("Max Number of Blocks  To be Partially Inlined"));
----------------
Expressing this as instructions will make this somewhat similar to inlining cost.


================
Comment at: lib/Transforms/IPO/PartialInlining.cpp:147
+    if (IsSuccessor(Succ1, Succ2)) {
+      CommSucc = Succ1;
+      OtherSucc = Succ2;
----------------
Cleaner to do return std::make_tuple(Succ1, Succ2) here and the following if


================
Comment at: lib/Transforms/IPO/PartialInlining.cpp:183
+
+    BasicBlock *CommSucc = nullptr;
+    BasicBlock *OtherSucc = nullptr;
----------------
No need to initialize it here since GetCommonSucc would return a (nullptr, nullptr) tuple if there is no triangle shape.


https://reviews.llvm.org/D32249





More information about the llvm-commits mailing list