diff options
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/Legalizer.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/Legalizer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp index dcddd671f51..b96827bd857 100644 --- a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp +++ b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp @@ -161,9 +161,10 @@ bool Legalizer::runOnMachineFunction(MachineFunction &MF) { } std::unique_ptr<MachineIRBuilder> MIRBuilder; GISelCSEInfo *CSEInfo = nullptr; - bool IsO0 = TPC.getOptLevel() == CodeGenOpt::Level::None; - // Disable CSE for O0. - bool EnableCSE = !IsO0 && EnableCSEInLegalizer; + bool EnableCSE = EnableCSEInLegalizer.getNumOccurrences() + ? EnableCSEInLegalizer + : TPC.isGISelCSEEnabled(); + if (EnableCSE) { MIRBuilder = make_unique<CSEMIRBuilder>(); std::unique_ptr<CSEConfig> Config = make_unique<CSEConfig>(); |