[PATCH] D128572: [LoongArch] Add codegen support for division operations

Xi Ruoyao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 22:45:17 PDT 2022


xry111 added inline comments.


================
Comment at: llvm/test/CodeGen/LoongArch/ir-instruction/sdiv-udiv-srem-urem.ll:132
+; LA64-NOTRAP-NEXT:    addi.w $a0, $a0, 0
+; LA64-NOTRAP-NEXT:    div.d $a0, $a0, $a1
+; LA64-NOTRAP-NEXT:    jirl $zero, $ra, 0
----------------
It looks suboptimal: "div.w $a0, $a0, $a1" should work so these two sign-extensions are not needed.

I'm not sure if it's easy to optimize this.  If an optimization is not suitable for this revision, we can do it later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128572



More information about the llvm-commits mailing list