From f248e7f3e774fad36761348ec41e75a73d75847b Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Mon, 14 Aug 2023 12:29:56 -0700 Subject: [PATCH] Config: If DumpIR is enabled, default enable a passmanager option If DumpIR is enabled but the PassManagerDumpIR option isn't enabled then this currently does nothing. As a convenience, enable dumping the final optimized IR if an option hasn't been specified. --- External/FEXCore/Source/Interface/Config/Config.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/External/FEXCore/Source/Interface/Config/Config.cpp b/External/FEXCore/Source/Interface/Config/Config.cpp index 260d4c211..aaca42e4a 100644 --- a/External/FEXCore/Source/Interface/Config/Config.cpp +++ b/External/FEXCore/Source/Interface/Config/Config.cpp @@ -412,6 +412,15 @@ namespace DefaultValues { } } + if (FEXCore::Config::Exists(FEXCore::Config::CONFIG_DUMPIR) && + !FEXCore::Config::Exists(FEXCore::Config::CONFIG_PASSMANAGERDUMPIR)) { + // If DumpIR is set but no PassManagerDumpIR configuration is set, then default to `afteropt` + FEX_CONFIG_OPT(PathName, DUMPIR); + if (PathName() != "no") { + EraseSet(FEXCore::Config::ConfigOption::CONFIG_PASSMANAGERDUMPIR, fextl::fmt::format("{}", static_cast(FEXCore::Config::PassManagerDumpIR::AFTEROPT))); + } + } + if (FEXCore::Config::Exists(FEXCore::Config::CONFIG_SINGLESTEP)) { // Single stepping also enforces single instruction size blocks Set(FEXCore::Config::ConfigOption::CONFIG_MAXINST, "1");