[PATCH] D138332: [Passes] Don't add CHR pass for CSIRInstr build in PostLink

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 14:01:55 PST 2022


xur added a comment.

In D138332#3938399 <https://reviews.llvm.org/D138332#3938399>, @tejohnson wrote:

> Where is the CSFDO annotation step in relation to this pass? If it would be annotated before this point on the subsequent CSFDO use compile, is the idea that we might as well wait for the CSFDO profile before performing post-link CHR?
>
> Presumably even if the profile is the same as the pre-link CHR, the code could be different after cross-module importing, inlining, other cleanup, so wouldn't that open up more opportunities potentially for CHR?

Thanks for asking this. I was under the impression that CHR pass was after CSFDO instrumentation and use. But when I checked the code, this was not the case. CHR is in FunctinSimplicaiton pipeline which is before ModuleOptimization pipeline where CSFDO happens.

I don't know the reason for doing CHR early -- CHR can increase the code size and thus affect inlining. Doing it later in the pipelie might make more sense.

As for this patch, now I would disable CHR for CSFDO instrumentation and use because the size increase for CSFDO (after inline) is out of control.
But this is not strictly needed if we have https://reviews.llvm.org/D138333.


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

https://reviews.llvm.org/D138332



More information about the llvm-commits mailing list