[clang] [llvm] [IPO] Declare LTO command line options in TableGen (PR #245301)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 24 21:58:48 PST 2026
================
@@ -112,23 +112,76 @@ defm : BoolField<"nofree-inference", "true",
"Infer nofree attribute during function-attrs pass">;
defm : BoolField<"nounwind-inference", "true",
"Infer nounwind attribute during function-attrs pass">;
+defm : BoolField<"thinlto-funcattrs", "false",
+ "Propagate function-attrs in thinLTO">;
// TODO: Remove the old spellings after 2027-05.
def : AliasOf<"disable-nofree-inference", "nofree-inference=false">;
def : AliasOf<"disable-nounwind-inference", "nounwind-inference=false">;
// FunctionImport.cpp
+defm : BoolField<"compute-dead", "true",
+ "Compute dead symbols">;
defm : BoolField<"enable-import-metadata", "false",
"Enable import metadata like 'thinlto_src_module' and 'thinlto_src_file'">;
+defm : BoolField<"force-import-all", "false",
+ "Import functions with noinline attribute">;
// Used when testing importing from distributed indexes via opt
// -function-import.
defm : BoolField<"import-all-index", "false",
"Import all external functions in index">;
+// FIXME: This multiplier was not really tuned up.
+defm : ValueField<"import-cold-multiplier", "float", "0",
+ "Multiply the `import-instr-limit` threshold for cold callsites">;
+defm : ValueField<"import-critical-multiplier", "float", "100.0",
+ "Multiply the `import-instr-limit` threshold for critical callsites">;
+defm : ValueField<"import-cutoff", "int", "-1",
+ "Only import first N functions if N>=0">;
+// This is a test-only option.
+// If this option is enabled, the ThinLTO indexing step will import each
+// function declaration as a fallback. In a real build this may increase ram
+// usage of the indexing step unnecessarily.
+// TODO: Implement selective import (based on combined summary analysis) to
+// ensure the imported function has a use case in the postlink pipeline.
+defm : BoolField<"import-declaration", "false",
+ "If true, import function declaration as fallback if the function definition is not imported">;
+// Narrower form of -import-declaration for indirect call promotion: when the
+// definition of a profiled indirect call target is not imported, import its
+// declaration and export it from its defining module, so that the backend can
+// promote the indirect call to it (see -icp-allow-decls).
+defm : BoolField<"import-declaration-for-indirect-calls", "false",
+ "If true, import a declaration of the target of an indirect call edge (and export it from its defining module) when its definition is not imported">;
+defm : EnumField<"import-declaration-for-indirect-calls-min-hotness", "CalleeInfo::HotnessType", "CalleeInfo::HotnessType::Hot",
+ "unknown,cold,none,hot,critical",
+ ["CalleeInfo::HotnessType::Unknown", "CalleeInfo::HotnessType::Cold", "CalleeInfo::HotnessType::None", "CalleeInfo::HotnessType::Hot", "CalleeInfo::HotnessType::Critical"],
+ "Minimum hotness of an indirect call edge for -import-declaration-for-indirect-calls to import a declaration of its target">;
+defm : ValueField<"import-hot-evolution-factor", "float", "1.0",
+ "As we import functions called from hot callsite, multiply the `import-instr-limit` threshold by this factor before processing newly imported functions">;
+defm : ValueField<"import-hot-multiplier", "float", "10.0",
+ "Multiply the `import-instr-limit` threshold for hot callsites">;
+defm : ValueField<"import-instr-evolution-factor", "float", "0.7",
----------------
MaskRay wrote:
Thanks for catching this! Fixed
https://github.com/llvm/llvm-project/pull/245301
More information about the cfe-commits
mailing list