[llvm] 37cf39f - [AArch64] Add test for incorrect stxp register allocation (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 02:21:38 PDT 2024


Author: Nikita Popov
Date: 2024-09-12T11:21:27+02:00
New Revision: 37cf39fdd7ab6dcfbce4633ea5fe743daf2ab358

URL: https://github.com/llvm/llvm-project/commit/37cf39fdd7ab6dcfbce4633ea5fe743daf2ab358
DIFF: https://github.com/llvm/llvm-project/commit/37cf39fdd7ab6dcfbce4633ea5fe743daf2ab358.diff

LOG: [AArch64] Add test for incorrect stxp register allocation (NFC)

This is a variant of https://github.com/llvm/llvm-project/issues/106380
without inline assembly.

Added: 
    

Modified: 
    llvm/test/CodeGen/AArch64/arm64-ldxr-stxr.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/AArch64/arm64-ldxr-stxr.ll b/llvm/test/CodeGen/AArch64/arm64-ldxr-stxr.ll
index 0153505250d6fb..1a60f8752dd571 100644
--- a/llvm/test/CodeGen/AArch64/arm64-ldxr-stxr.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-ldxr-stxr.ll
@@ -353,6 +353,18 @@ define dso_local i32 @test_store_release_i64(i32, i64 %val, ptr %addr) {
   ret i32 %res
 }
 
+; The stxp result cannot be allocated to the same register as the inputs.
+; FIXME: This is a miscompile.
+define dso_local i32 @test_stxp_undef(ptr %p, i64 %x) nounwind {
+; CHECK-LABEL: test_stxp_undef:
+; CHECK:       // %bb.0:
+; CHECK-NEXT:    stxp w8, x8, x1, [x0]
+; CHECK-NEXT:    mov w0, w8
+; CHECK-NEXT:    ret
+  %res = call i32 @llvm.aarch64.stxp(i64 undef, i64 %x, ptr %p)
+  ret i32 %res
+}
+
 declare i32 @llvm.aarch64.stlxr.p0(i64, ptr) nounwind
 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
 ; FALLBACK: {{.*}}


        


More information about the llvm-commits mailing list