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

Aochang Liu via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 18:54:08 PDT 2026


================
@@ -0,0 +1,37 @@
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -O2 | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -O2 -stop-after=finalize-isel | FileCheck %s --check-prefix=MIR
+
+; When an x86_regcall argument uses a 32-bit subregister (R14D), the call
+; preserved mask must also clear the 64-bit superregister (R14). Otherwise a
+; live i64 in R14 can be incorrectly preserved across the call.
+;
+; Related to llvm/llvm-project#225057.
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define x86_regcallcc void @callee(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, i64 %a7, i64 %a8, i32 %a9) noinline nounwind {
----------------
HelloWorldU wrote:

Can this be a declaration? The test only checks the code generated for main.

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


More information about the llvm-commits mailing list