NoSignedZerosFPMath(false),
HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
GuaranteedTailCallOpt(false), StackSymbolOrdering(true),
- EnableFastISel(false), UseInitArray(false),
+ EnableFastISel(false), EnableGlobalISel(false), UseInitArray(false),
DisableIntegratedAS(false), RelaxELFRelocations(false),
FunctionSections(false), DataSections(false),
UniqueSectionNames(true), TrapUnreachable(false), EmulatedTLS(false),
/// compile time.
unsigned EnableFastISel : 1;
+ /// EnableGlobalISel - This flag enables global instruction selection.
+ unsigned EnableGlobalISel : 1;
+
/// UseInitArray - Use .init_array instead of .ctors for static
/// constructors.
unsigned UseInitArray : 1;
EnableFastISelOption("fast-isel", cl::Hidden,
cl::desc("Enable the \"fast\" instruction selector"));
-static cl::opt<cl::boolOrDefault>
- EnableGlobalISel("global-isel", cl::Hidden,
- cl::desc("Enable the \"global\" instruction selector"));
+static cl::opt<cl::boolOrDefault> EnableGlobalISelOption(
+ "global-isel", cl::Hidden,
+ cl::desc("Enable the \"global\" instruction selector"));
static cl::opt<std::string> PrintMachineInstrs(
"print-machineinstrs", cl::ValueOptional, cl::desc("Print machine instrs"),
}
bool TargetPassConfig::addCoreISelPasses() {
- // Enable FastISel with -fast, but allow that to be overridden.
+ // Enable FastISel with -fast-isel, but allow that to be overridden.
TM->setO0WantsFastISel(EnableFastISelOption != cl::BOU_FALSE);
if (EnableFastISelOption == cl::BOU_TRUE ||
(TM->getOptLevel() == CodeGenOpt::None && TM->getO0WantsFastISel()))
TM->setFastISel(true);
- // Ask the target for an isel.
- // Enable GlobalISel if the target wants to, but allow that to be overriden.
+ // Ask the target for an instruction selector.
+ bool EnableGlobalISel = TM->Options.EnableGlobalISel;
// Explicitly enabling fast-isel should override implicitly enabled
// global-isel.
- if (EnableGlobalISel == cl::BOU_TRUE ||
- (EnableGlobalISel == cl::BOU_UNSET && isGlobalISelEnabled() &&
- EnableFastISelOption != cl::BOU_TRUE)) {
+ if (EnableGlobalISel && (EnableGlobalISelOption == cl::BOU_UNSET) &&
+ (EnableFastISelOption == cl::BOU_TRUE))
+ EnableGlobalISel = false;
+ if (EnableGlobalISelOption == cl::BOU_TRUE)
+ EnableGlobalISel = true;
+
+ if (EnableGlobalISel) {
if (addIRTranslator())
return true;
//===---------------------------------------------------------------------===//
/// GlobalISel Configuration
//===---------------------------------------------------------------------===//
-
-bool TargetPassConfig::isGlobalISelEnabled() const {
- return false;
-}
-
bool TargetPassConfig::isGlobalISelAbortEnabled() const {
if (EnableGlobalISelAbort.getNumOccurrences() > 0)
return EnableGlobalISelAbort == 1;
// When no abort behaviour is specified, we don't abort if the target says
// that GISel is enabled.
- return !isGlobalISelEnabled();
+ return !TM->Options.EnableGlobalISel;
}
bool TargetPassConfig::reportDiagnosticWhenGlobalISelFallback() const {
getEffectiveCodeModel(TT, CM, JIT), OL),
TLOF(createTLOF(getTargetTriple())), isLittle(LittleEndian) {
initAsmInfo();
+
+ // Enable GlobalISel at or below EnableGlobalISelAt0.
+ if (getOptLevel() <= EnableGlobalISelAtO)
+ setGlobalISel(true);
}
AArch64TargetMachine::~AArch64TargetMachine() = default;
void addPostRegAlloc() override;
void addPreSched2() override;
void addPreEmitPass() override;
-
- bool isGlobalISelEnabled() const override;
};
} // end anonymous namespace
return false;
}
-bool AArch64PassConfig::isGlobalISelEnabled() const {
- return TM->getOptLevel() <= EnableGlobalISelAtO;
-}
-
bool AArch64PassConfig::addILPOpts() {
if (EnableCondOpt)
addPass(createAArch64ConditionOptimizerPass());