[PATCH] D134336: [AArch64] Lower multiplication by a constant int to madd

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 13:23:04 PDT 2022


efriedma added a comment.

Perf seems fine, then.



================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5922
+        BuildMI(MF, Root.getDebugLoc(), TII->get(MovI->Opcode), NewVR)
+            .addImm(MovI->Op1)
+            .addImm(MovI->Op2);
----------------
Sorry, missed an issue here the first time I looked at this...

The current complete set of opcodes that immediate expansion can produce is listed in AArch64ExpandPseudo::expandMOVImm .  If the opcode is movz/movn, there are two immediate operands.  But the opcode can also be ORRWri/ORRXri; in that case, there a register operand (wzr/xzr), and an immediate operand.

I think this comes up for something like `int f(int a) { return a * 44 + 16773120; }`.


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

https://reviews.llvm.org/D134336



More information about the llvm-commits mailing list