[llvm-branch-commits] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)
Anatoly Trosinenko via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Apr 8 03:29:53 PDT 2025
================
@@ -191,16 +201,27 @@ define void @test_tailcall_omit_mov_x16_x16(ptr %objptr) #0 {
define i32 @test_call_omit_extra_moves(ptr %objptr) #0 {
; CHECK-LABEL: test_call_omit_extra_moves:
; DARWIN-NEXT: stp x29, x30, [sp, #-16]!
-; ELF-NEXT: str x30, [sp, #-16]!
-; CHECK-NEXT: ldr x16, [x0]
-; CHECK-NEXT: mov x17, x0
-; CHECK-NEXT: movk x17, #6503, lsl #48
-; CHECK-NEXT: autda x16, x17
-; CHECK-NEXT: ldr x8, [x16]
-; CHECK-NEXT: movk x16, #34646, lsl #48
-; CHECK-NEXT: blraa x8, x16
-; CHECK-NEXT: mov w0, #42
+; DARWIN-NEXT: ldr x16, [x0]
+; DARWIN-NEXT: mov x17, x0
+; DARWIN-NEXT: movk x17, #6503, lsl #48
+; DARWIN-NEXT: autda x16, x17
+; DARWIN-NEXT: ldr x8, [x16]
+; DARWIN-NEXT: movk x16, #34646, lsl #48
+; DARWIN-NEXT: blraa x8, x16
+; DARWIN-NEXT: mov w0, #42
; DARWIN-NEXT: ldp x29, x30, [sp], #16
+; ELF-NEXT: str x30, [sp, #-16]!
+; ELF-NEXT: ldr x8, [x0]
+; ELF-NEXT: mov x9, x0
+; ELF-NEXT: movk x9, #6503, lsl #48
+; ELF-NEXT: autda x8, x9
+; ELF-NEXT: ldr x9, [x8]
+; FIXME: Get rid of the x16/x17 constraint on non-Darwin so we can eliminate
+; this mov.
+; ELF-NEXT: mov x17, x8
+; ELF-NEXT: movk x17, #34646, lsl #48
+; ELF-NEXT: blraa x9, x17
+; ELF-NEXT: mov w0, #42
; ELF-NEXT: ldr x30, [sp], #16
; CHECK-NEXT: ret
----------------
atrosinenko wrote:
Sorry, didn't notice that one of the instructions is a call.
https://github.com/llvm/llvm-project/pull/132857
More information about the llvm-branch-commits
mailing list