wenlei added a comment.

> I wonder if this is just a single example, where there could be various other 
> (header-related) peepholes that cause similar problems for stable output. 
> IIRC, the usual Clang approach is to make as-close-to-optimal IR up front, 
> but maybe in some situations it's desirable to delay optimizations to improve 
> stability. Another application where that could be useful is caching.

I think this nounwind propagation a classic IPA problem, where you need proper 
per-function summary first and then propagate that through call graph to get 
final per-function attribute (like Attributor). Frontend is not the right place 
to do this kind of IPA/IPO.

> Do we want IRGen to prefer stable IR, or optimized IR? Should there be a -cc1 
> flag to decide (which AutoFDO could set)?

Unstable IR is a side of trying to do IPA in frontend which is naturally going 
to be half-complete.

I'm not sure if I follow why invoke -> call optimization can not be done in 
mid-end. If possible, I think this should be deferred to mid-end.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83906

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to