================
@@ -198,6 +204,31 @@ static void RegisterPassPlugins(ArrayRef<std::string>
PassPlugins,
}
}
+// Register instrumentation passes that need to run late in the pipeline; these
+// are non-optimization passes and need to run after most optimizations to
avoid
+// interfering with them (e.g. PGHO) or to capture the final state of the code.
+static void registerBackendInstrumentation(PassBuilder &PB) {
+ if (!LTOAllocTokenMode.empty()) {
+ AllocTokenOptions Opts;
+ if (auto Mode = getAllocTokenModeFromString(LTOAllocTokenMode))
+ Opts.Mode = *Mode;
+ else
+ report_fatal_error("invalid lto-alloc-token-mode: " +
+ Twine(LTOAllocTokenMode));
+
+ // ThinLTO backend
+ PB.registerOptimizerLastEPCallback(
----------------
melver wrote:
Thanks, I reworked the patches. PTAL.
https://github.com/llvm/llvm-project/pull/169358
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits