[PATCH] D110476: [AArch64] Optimize add/sub with immediate

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 25 06:10:56 PDT 2021


benshi001 added inline comments.


================
Comment at: llvm/test/CodeGen/AArch64/addimm-mulimm.ll:56
 ; CHECK-NEXT:    mov w8, #37
-; CHECK-NEXT:    movk w9, #17, lsl #16
-; CHECK-NEXT:    madd x0, x0, x8, x9
+; CHECK-NEXT:    mul x8, x0, x8
+; CHECK-NEXT:    add x8, x8, #280, lsl #12 // =1146880
----------------
I think this is still a win, since an extra register w9 is saved, although the total amount of instructions does not change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110476



More information about the llvm-commits mailing list