[llvm-branch-commits] [llvm] [AArch64][PAC] Eliminate excessive MOVs when computing blend (PR #115185)

Daniil Kovalev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 11 00:00:34 PST 2024


================
@@ -163,8 +163,15 @@ class AArch64AsmPrinter : public AsmPrinter {
   // Emit the sequence for AUT or AUTPAC.
   void emitPtrauthAuthResign(const MachineInstr *MI);
 
-  // Emit the sequence to compute a discriminator into x17, or reuse AddrDisc.
-  unsigned emitPtrauthDiscriminator(uint16_t Disc, unsigned AddrDisc);
+  // Emit the sequence to compute the discriminator.
+  // ScratchReg should be x16/x17.
+  // The returned register is either unmodified AddrDisc or x16/x17.
+  // If the expanded pseudo is allowed to clobber AddrDisc register, setting
+  // MayUseAddrAsScratch may save one MOV instruction, provided the address
----------------
kovdan01 wrote:

Could you please add a comment with an example of optimized sequence (which is present in PR description) to code? W/o that, it might not be very clear what particularly is meant when talking about saving mov instruction. Also, it looks like that two instructions are saved, not one (as said in comment here), if I understand the example from the PR description correctly.

https://github.com/llvm/llvm-project/pull/115185


More information about the llvm-branch-commits mailing list