[PATCH] D100769: [RISCV] Optimize addition with immediate
    Craig Topper via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Apr 19 09:18:37 PDT 2021
    
    
  
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1298
+let Predicates = [IsRV64] in
+def : Pat<(sext_inreg (add GPR:$rs1, (AddiPair GPR:$rs2)), i32),
+          (ADDIW (ADDIW GPR:$rs1, (AddiPairImmB GPR:$rs2)),
----------------
Do we need to make sure sext_inreg is the only user of the add? Otherwise we’ll emit two ADDIWs and two ADDIs.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100769/new/
https://reviews.llvm.org/D100769
    
    
More information about the llvm-commits
mailing list