[PATCH] D145210: [Pipeline] Adjust PostOrderFunctionAttrs placement in simplification pipeline

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 14:45:24 PDT 2023


cfang added inline comments.


================
Comment at: llvm/lib/Passes/PassBuilderPipelines.cpp:838
+  // functions.
+  MainCGPipeline.addPass(PostOrderFunctionAttrsPass(/*SkipNonRecursive*/ true));
 
----------------
aeubanks wrote:
> cfang wrote:
> > We found that "nofree" attribute will greatly affect the earlyCSE pass in function simplification. In our case, missing nofree essentially disabled earlyCSE which resulted in a huge performance regression (register pressure).   Other optimizations like GVN in function simplification may also be affected by function attributes.
> > 
> > So is it possible that we just run this pass twice?   Thanks.
> Can you give an example where EarlyCSE depends on function attributes? That doesn't really make sense to me, function attributes should really be used by callers of the function, not the function itself.
EarlyCSE can make use of the attributes of the functions it calls. 
The pass manager should be running passes such that the attributes
of callees are known before running optimizations on the callers


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145210



More information about the llvm-commits mailing list