[PATCH] D148010: [Pipelines] Don't run module optimization in full LTO pre-link

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 07:47:37 PDT 2023


nikic added a comment.

In D148010#4263777 <https://reviews.llvm.org/D148010#4263777>, @aeubanks wrote:

> makes sense in theory since the module optimization pipeline really only needs to be run once per function, but it looks like there are some passes in the module optimization that aren't in the lto post-link pipeline, like RelLookupTableConverterPass, DivRemPairsPass, LoopSink

Good point. I've added LoopSink and DivRemPairs to the LTO pipeline in D148343 <https://reviews.llvm.org/D148343>. It's worth noting that these are close to useless in the pre-link pipeline, because they are de-canonicalizing transforms, which will get undone by the post-link passes. There is no point in running these pre-link.

I also happened across D148120 <https://reviews.llvm.org/D148120> today, which is one of those cases where doing module optimization pre-link hurts optimization quality, because code gets vectorized pre-link before the trip count becomes known post-link.


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

https://reviews.llvm.org/D148010



More information about the llvm-commits mailing list