[clang] [llvm] [EntryExitInstrumenter] Move passes out of clang into LLVM default pipelines (PR #92171)

Egor Pasko via cfe-commits cfe-commits at lists.llvm.org
Thu May 30 07:04:26 PDT 2024


================
@@ -1030,6 +1036,12 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
       Phase != ThinOrFullLTOPhase::ThinLTOPostLink)
     MPM.addPass(SampleProfileProbePass(TM));
 
+  // Instrument function entry and exit before all inlining.
+  if (!isLTOPostLink(Phase)) {
+    MPM.addPass(createModuleToFunctionPassAdaptor(
----------------
pasko wrote:

> the check for `Phase != ThinOrFullLTOPhase::FullLTOPostLink` is unnecessary, `buildModuleSimplificationPipeline` isn't called for FullLTO post link

Removed. Indeed there is an assertion for this a few lines prior.

> I'm not sure why you're seeing that behavior if we're only running the post-inline instrumenter once in the codegen pipeline

Apparently I made a mistake when building the reproducer. When checking today I saw everything working as expected, i.e. <=1 bare hooks inserted per function in the final DSO. Sorry for the noise.

https://github.com/llvm/llvm-project/pull/92171


More information about the cfe-commits mailing list