[PATCH] D79747: [PowerPC] Implementation of Simple Outliner Module Pass

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 23:11:29 PDT 2020


shchenz added a comment.

1: I like the idea about reducing csr cost in prologue/epilogue by outlining some function bodies. Any special reason for applying this pass only on PowerPC? I think many other platforms also can benefit from this pass.

2: Is there any plan to extend the light path definition. Currently in this pass a light path is a path from entry block directly to exit block. But I think light path can be more general. A simple example

  //   ENTRY
  //     |
  //    BB1 
  //    / \    
  //   |  BB2    
  //   |   | \     
  //   |  ANY BLOCKS   
  //   |  /                   
  //   RET
  //

A light path for this case can be ENTRY->BB1->RET and outline other blocks.

If we plan to extend light path definition, I think better to do a little change in the code framework. Eg: define a function like `findLightPath()` in `tryOutlining` instead of hard code the light path?

3: After get the light path, I think it’s better to call interfaces in class `CodeExtractor` to do outlining like `hotcoldsplitting` pass and `PartialInliner` pass did.



================
Comment at: llvm/lib/Target/PowerPC/PPCSimpleOutliner.cpp:274
+
+bool PPCSimpleOutliner::runOnModule(Module &M) {
+  if (M.empty())
----------------
Can this be a function pass?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79747





More information about the llvm-commits mailing list