[PATCH] D118428: [clang-cl] Support the /JMC flag

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 13:26:40 PST 2022


ychen added a comment.

In D118428#3294880 <https://reviews.llvm.org/D118428#3294880>, @rnk wrote:

> In D118428#3294411 <https://reviews.llvm.org/D118428#3294411>, @ychen wrote:
>
>> The passes in `lib/Transforms/Instrumentation` runs with `EmitAssemblyHelper::RunOptimizationPipeline`. JMC pass runs with `EmitAssemblyHelper::RunCodegenPipeline`.
>
> Sure, but that's a choice. Most of the instrumentation passes (ASan) are also designed to run late to avoid interfering with middle end optimization. Is there a specific reason that JMC has to be a codegen pass? Maybe you've already mentioned it, apologies if so.

The instrumentation is per-function, ideally for each function that has debuginfo and ends up in the executable. So I want it to happen the last in the IR codegen pipeline (target could arrange additional IR passes, they may duplicate functions or anything). Making it codegen pass also makes it LTO-friendly, otherwise, I need to make sure the pass runs once. The JMC pass could be a machine-independent MIR pass too, but I think there is not much benefit for that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118428



More information about the llvm-commits mailing list