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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 13:33:32 PST 2022


rnk added a comment.

In D118428#3294935 <https://reviews.llvm.org/D118428#3294935>, @ychen wrote:

> 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.

I would argue that function passes shouldn't do function duplication, but being LTO friendly is a pretty good reason to want to do instrumentation as part of the codegen pipeline. We have encountered problems with sanitizer passes running twice in LTO scenarios, and it's annoying to deal with.

So, I think that's a compelling reason to go with your current structure.


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