[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

Nikita Popov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 15 06:37:16 PDT 2021


nikic added a comment.

In D106891#2945342 <https://reviews.llvm.org/D106891#2945342>, @arsenm wrote:

> I don’t think constructing in the pass is the solution. Why exactly is this introducing such a big slowdown?

The reason are the additional DominatorTree and LoopInfo calculations. These have a big impact at `O0`. These analysis calculations are caused by a deficiency in the legacy pass manager, which is still used for the codegen pipeline: Even though these analyses are only needed if diagnostic hotness is used, the pass manager requires them to be scheduled unconditionally.

The way to avoid this is to construct ORE without going through the pass manager. Grep for `OptimizationRemarkEmitter ORE` for various passes that already do this (though the reason is different in some cases -- there are some analysis preservation concerns with loop passes).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106891



More information about the cfe-commits mailing list