[PATCH] D54748: [PartialInliner] Skip PHIs in entry BB of outlined region.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 10:08:18 PST 2018


davidxl added inline comments.


================
Comment at: lib/Transforms/IPO/PartialInlining.cpp:334
   // inline cost analysis, there is no clear distinction there either).
-  static int computeBBInlineCost(BasicBlock *BB);
+  static int computeBBInlineCost(BasicBlock *BB, bool IsEntryBB = false);
 
----------------
Can you add documentation of IsEntryBB parameter (though it seems obvious)?


================
Comment at: lib/Transforms/IPO/PartialInlining.cpp:857
+    // CodeExtractor, so skip them when computing the region cost.
+    if (IsEntryBB && isa<PHINode>(I))
+      continue;
----------------
Since you are here, i think it is better to skip all 'nop' operations including (regardless wether it is in entry or not).
1) debugintrinsic (already skipped)
2) phi node
3) nop casting
3) functions calls that does not lower to actual calls (TTI.isLoweredToCall())


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54748/new/

https://reviews.llvm.org/D54748





More information about the llvm-commits mailing list