[PATCH] D147406: [LoongArch] Optimize multiplication with immediates
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 2 19:06:02 PDT 2023
benshi001 added inline comments.
================
Comment at: llvm/test/CodeGen/LoongArch/ir-instruction/mul.ll:1038-1040
+; LA64-NEXT: slli.d $a1, $a0, 1
+; LA64-NEXT: slli.d $a0, $a0, 12
+; LA64-NEXT: add.w $a0, $a0, $a1
----------------
benshi001 wrote:
> xen0n wrote:
> > Kind of interesting why this didn't get optimized into the same form as LA32, but there may be a deeper reason. I don't currently have time to look into this though.
> I will take a look later, however this is still a win, since total 4 instructions are reduced to 3 ones.
Maybe we can accept current form, and I will submit another patch for this further optimization.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147406/new/
https://reviews.llvm.org/D147406
More information about the llvm-commits
mailing list