[llvm] [AArch64] update "rm" inline asm test (PR #67472)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 11:28:51 PDT 2023


https://github.com/nickdesaulniers created https://github.com/llvm/llvm-project/pull/67472

Because `x0` is not listed in the clobber list, regalloc could (one day
when #20571 is fixed) allocate `$0` to `x0`:

  ldr x0, x0

This will produce an error when validating the instruction. The intent
of this test FWICT is to check that the parameter in w0 is stored to a
stack slot using w0, since this target triple is the exotic arm64_32
(ILP32). Update the test to simply use "m" constraint. The clobber list
is underconstrained otherwise.


>From f539503038a94898afc792e27d4f164bc10e69cc Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Tue, 26 Sep 2023 11:07:03 -0700
Subject: [PATCH] [AArch64] update "rm" inline asm test

Because `x0` is not listed in the clobber list, regalloc could (one day
when #20571 is fixed) allocate `$0` to `x0`:

  ldr x0, x0

This will produce an error when validating the instruction. The intent
of this test FWICT is to check that the parameter in w0 is stored to a
stack slot using w0, since this target triple is the exotic arm64_32
(ILP32). Update the test to simply use "m" constraint. The clobber list
is underconstrained otherwise.
---
 llvm/test/CodeGen/AArch64/arm64_32.ll | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/test/CodeGen/AArch64/arm64_32.ll b/llvm/test/CodeGen/AArch64/arm64_32.ll
index d3b30d398ffcc3c..16e2e84a14329d1 100644
--- a/llvm/test/CodeGen/AArch64/arm64_32.ll
+++ b/llvm/test/CodeGen/AArch64/arm64_32.ll
@@ -649,7 +649,7 @@ define <2 x ptr> @test_pointer_vec_load(ptr %addr) {
 define void @test_inline_asm_mem_pointer(ptr %in) {
 ; CHECK-LABEL: test_inline_asm_mem_pointer:
 ; CHECK: str w0,
-  tail call void asm sideeffect "ldr x0, $0", "rm"(ptr %in)
+  tail call void asm sideeffect "ldr x0, $0", "m"(ptr %in)
   ret void
 }
 



More information about the llvm-commits mailing list