[llvm] [AArch64] Fix handling of x29/x30 in inline assembly clobbers (PR #167783)

Lukáš Lalinský via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 29 03:17:14 PST 2025


================
@@ -0,0 +1,36 @@
+; RUN: llc -mtriple=aarch64 -verify-machineinstrs < %s | FileCheck %s
+
+; Test that both numeric register names (x29, x30) and their architectural
+; aliases (fp, lr) work correctly as clobbers in inline assembly.
+
+define void @clobber_x29() nounwind {
+; CHECK-LABEL: clobber_x29:
+; CHECK:       str x29, [sp
+; CHECK:       ldr x29, [sp
+  tail call void asm sideeffect "", "~{x29}"()
----------------
lalinsky wrote:

Sorry for the delay, I had to focus on other things. I've updated the test, still without `nop`, because I still need to match the `APP` comment when using `CHECK-NEXT`, so the `nop` is not really needed.

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


More information about the llvm-commits mailing list