[PATCH] D147406: [LoongArch] Optimize multiplication with immediates
WÁNG Xuěruì via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 2 19:11:38 PDT 2023
xen0n accepted this revision.
xen0n added inline comments.
This revision is now accepted and ready to land.
================
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:
> 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.
Fine with me, thanks!
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