Skip to content

[CodeGen][NewPM] Add necessary codegen options #70904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions llvm/include/llvm/Target/CGPassBuilderOption.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ struct CGPassBuilderOption {
bool DisableVerify = false;
bool EnableImplicitNullChecks = false;
bool EnableBlockPlacementStats = false;
bool EnableMachineFunctionSplitter = false;
bool MISchedPostRA = false;
bool EarlyLiveIntervals = false;
bool GCEmptyBlocks = false;

bool DisableLSR = false;
bool DisableCGP = false;
Expand All @@ -41,16 +43,25 @@ struct CGPassBuilderOption {
bool DisablePartialLibcallInlining = false;
bool DisableConstantHoisting = false;
bool DisableSelectOptimize = true;
bool DisableAtExitBasedGlobalDtorLowering = false;
bool DisableExpandReductions = false;
bool DisableRAFSProfileLoader = false;
bool DisableCFIFixup = false;
bool PrintAfterISel = false;
bool PrintISelInput = false;
bool RequiresCodeGenSCCOrder = false;

RunOutliner EnableMachineOutliner = RunOutliner::TargetDefault;
RegAllocType RegAlloc = RegAllocType::Default;
std::optional<GlobalISelAbortMode> EnableGlobalISelAbort;
std::string FSProfileFile;
std::string FSRemappingFile;

std::optional<bool> VerifyMachineCode;
std::optional<bool> EnableFastISelOption;
std::optional<bool> EnableGlobalISelOption;
std::optional<bool> DebugifyAndStripAll;
std::optional<bool> DebugifyCheckAndStripAll;
};

CGPassBuilderOption getCGPassBuilderOption();
Expand Down
10 changes: 10 additions & 0 deletions llvm/lib/CodeGen/TargetPassConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ CGPassBuilderOption llvm::getCGPassBuilderOption() {
SET_OPTION(EnableIPRA)
SET_OPTION(OptimizeRegAlloc)
SET_OPTION(VerifyMachineCode)
SET_OPTION(DisableAtExitBasedGlobalDtorLowering)
SET_OPTION(DisableExpandReductions)
SET_OPTION(PrintAfterISel)
SET_OPTION(FSProfileFile)
SET_OPTION(GCEmptyBlocks)

#define SET_BOOLEAN_OPTION(Option) Opt.Option = Option;

Expand All @@ -490,6 +495,11 @@ CGPassBuilderOption llvm::getCGPassBuilderOption() {
SET_BOOLEAN_OPTION(DisableSelectOptimize)
SET_BOOLEAN_OPTION(PrintLSR)
SET_BOOLEAN_OPTION(PrintISelInput)
SET_BOOLEAN_OPTION(DebugifyAndStripAll)
SET_BOOLEAN_OPTION(DebugifyCheckAndStripAll)
SET_BOOLEAN_OPTION(DisableRAFSProfileLoader)
SET_BOOLEAN_OPTION(DisableCFIFixup)
SET_BOOLEAN_OPTION(EnableMachineFunctionSplitter)

return Opt;
}
Expand Down