[PATCH] D130769: [RISCV] Combine and remove redundant ADD/SUB instructions

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 08:46:51 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetMachine.cpp:243
+  if (TM->getOptLevel() != CodeGenOpt::None)
+    addPass(createRISCVAddSubCombinerPass());
 }
----------------
eklepilkina wrote:
> craig.topper wrote:
> > Should this be done before branch folding since it removes instructions which could reduce jump distance?
> This impossible, because `BranchFolder` is set in pipeline before `TailDuplicationPass` that combines these redundant instructions in one BB.
Sorry. I meant to write BranchRelaxation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130769/new/

https://reviews.llvm.org/D130769



More information about the llvm-commits mailing list