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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 14:24:57 PST 2020


craig.topper created this revision.
craig.topper added reviewers: asb, lenary, luismarques.
Herald added subscribers: frasercrmck, NickHung, evandro, apazos, sameer.abuasal, pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: LLVM.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.

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.


https://reviews.llvm.org/D92511

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


Index: llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+++ llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
@@ -182,5 +182,6 @@
 }
 
 void RISCVPassConfig::addPreRegAlloc() {
-  addPass(createRISCVMergeBaseOffsetOptPass());
+  if (TM->getOptLevel() != CodeGenOpt::None)
+    addPass(createRISCVMergeBaseOffsetOptPass());
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92511.309061.patch
Type: text/x-patch
Size: 434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201202/8143801f/attachment.bin>


More information about the llvm-commits mailing list