[llvm-branch-commits] [llvm] 92c0d5d - [RISCV] Remove RISCVMergeBaseOffsetOpt from the -O0 pass pipeline.
Craig Topper via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Dec 3 10:02:52 PST 2020
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());
}
More information about the llvm-branch-commits
mailing list