[llvm] [X86] Clear regcall arg aliases in dynamic CSR masks (PR #225262)

Aochang Liu via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 02:57:40 PDT 2026


================
@@ -2682,12 +2683,16 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
     unsigned RegMaskSize = MachineOperand::getRegMaskSize(TRI->getNumRegs());
     memcpy(RegMask, Mask, sizeof(RegMask[0]) * RegMaskSize);
 
-    // Make sure all sub registers of the argument registers are reset
-    // in the RegMask.
+    // Make sure all aliases of the argument registers are reset in the
+    // RegMask, including superregisters. Clearing only subregs_inclusive is
+    // insufficient: an i32 argument in R14D must also remove R14 from the
+    // preserved set, otherwise a live 64-bit value in R14 can be incorrectly
+    // kept across the call (see llvm/llvm-project#225057).
----------------
HelloWorldU wrote:

Nit: Don't pass specific issue link, keep this comment only about its responsibility and function.

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


More information about the llvm-commits mailing list