Author: Craig Topper
Date: 2020-12-03T09:58:25-08:00
New Revision: 92c0d5d9581143695cc2214ccd83a54b9eaa4936

URL: 
https://github.com/llvm/llvm-project/commit/92c0d5d9581143695cc2214ccd83a54b9eaa4936
DIFF: 
https://github.com/llvm/llvm-project/commit/92c0d5d9581143695cc2214ccd83a54b9eaa4936.diff

LOG: [RISCV] Remove RISCVMergeBaseOffsetOpt from the -O0 pass pipeline.

Internally the pass skips any function with the optnone attribute. But that 
still requires checking each function. If the opt level is set to None we might 
as well just skip putting in the pipeline at all. This what is already done for 
many of the passes added by TargetPassConfig.

Differential Revision: https://reviews.llvm.org/D92511

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp 
b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
index 5bd49bd7a7ff..99515ab335a8 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
@@ -183,5 +183,6 @@ void RISCVPassConfig::addPreEmitPass2() {
 }
 
 void RISCVPassConfig::addPreRegAlloc() {
-  addPass(createRISCVMergeBaseOffsetOptPass());
+  if (TM->getOptLevel() != CodeGenOpt::None)
+    addPass(createRISCVMergeBaseOffsetOptPass());
 }


        
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to