Skip to content

Commit fa4f923

Browse files
committed
Test generated asm, remove dead LOADgotAUTH
1 parent 08a382e commit fa4f923

File tree

5 files changed

+165
-71
lines changed

5 files changed

+165
-71
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,8 @@ let Predicates = [HasPAuth] in {
19951995

19961996
def LOADgotAUTH : Pseudo<(outs GPR64common:$dst), (ins i64imm:$addr), []>,
19971997
Sched<[WriteI, ReadI]> {
1998+
// Make it possible to eliminate dead instruction after folding it into LOADgotPAC.
1999+
let hasSideEffects = 0;
19982000
let Defs = [X16,X17,NZCV];
19992001
let Size = 44;
20002002
}

llvm/test/CodeGen/AArch64/GlobalISel/ptrauth-constant-in-code.ll

Lines changed: 82 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,45 @@ define ptr @foo() {
8282

8383
; RUN: llc < finalize-isel.ll -mtriple aarch64-elf -mattr=+pauth -global-isel=1 \
8484
; RUN: -verify-machineinstrs -global-isel-abort=1 -stop-after=finalize-isel | \
85-
; RUN: FileCheck --check-prefixes=ISEL,ISEL-ELF %s
85+
; RUN: FileCheck --check-prefixes=ISEL-MIR,ISEL-MIR-ELF %s
8686
; RUN: llc < finalize-isel.ll -mtriple arm64-apple-ios -mattr=+pauth -global-isel=1 \
8787
; RUN: -verify-machineinstrs -global-isel-abort=1 -stop-after=finalize-isel | \
88-
; RUN: FileCheck --check-prefixes=ISEL %s
88+
; RUN: FileCheck --check-prefixes=ISEL-MIR %s
89+
; RUN: llc < finalize-isel.ll -mtriple aarch64-elf -mattr=+pauth -global-isel=1 \
90+
; RUN: -verify-machineinstrs -global-isel-abort=1 -asm-verbose=0 | \
91+
; RUN: FileCheck --check-prefixes=ISEL-ASM,ISEL-ASM-ELF %s
92+
; RUN: llc < finalize-isel.ll -mtriple arm64-apple-ios -mattr=+pauth -global-isel=1 \
93+
; RUN: -verify-machineinstrs -global-isel-abort=1 -asm-verbose=0 | \
94+
; RUN: FileCheck --check-prefixes=ISEL-ASM,ISEL-ASM-MACHO %s
8995

9096
@const_table_local = dso_local constant [3 x ptr] [ptr null, ptr null, ptr null]
9197
@const_table_got = constant [3 x ptr] [ptr null, ptr null, ptr null]
9298

9399
define void @store_signed_const_local(ptr %dest) {
94-
; ISEL-LABEL: name: store_signed_const_local
95-
; ISEL: body:
96-
; ISEL: %0:gpr64common = COPY $x0
97-
; ISEL-NEXT: %10:gpr64common = MOVaddr target-flags(aarch64-page) @const_table_local + 8, target-flags(aarch64-pageoff, aarch64-nc) @const_table_local + 8
98-
; ISEL-NEXT: %2:gpr64common = PAUTH_BLEND %0, 1234
99-
; ISEL-NEXT: %15:gpr64noip = COPY %2
100-
; ISEL-NEXT: MOVaddrPAC @const_table_local + 8, 2, %15, 0, implicit-def $x16, implicit-def $x17
101-
; ISEL-NEXT: %4:gpr64 = COPY $x16
102-
; ISEL-NEXT: %14:gpr64 = COPY %4
103-
; ISEL-NEXT: STRXui %14, %0, 0 :: (store (p0) into %ir.dest)
104-
; ISEL-NEXT: RET_ReallyLR
100+
; ISEL-MIR-LABEL: name: store_signed_const_local
101+
; ISEL-MIR: body:
102+
; ISEL-MIR: %0:gpr64common = COPY $x0
103+
; ISEL-MIR-NEXT: %10:gpr64common = MOVaddr target-flags(aarch64-page) @const_table_local + 8, target-flags(aarch64-pageoff, aarch64-nc) @const_table_local + 8
104+
; ISEL-MIR-NEXT: %2:gpr64common = PAUTH_BLEND %0, 1234
105+
; ISEL-MIR-NEXT: %15:gpr64noip = COPY %2
106+
; ISEL-MIR-NEXT: MOVaddrPAC @const_table_local + 8, 2, %15, 0, implicit-def $x16, implicit-def $x17
107+
; ISEL-MIR-NEXT: %4:gpr64 = COPY $x16
108+
; ISEL-MIR-NEXT: %14:gpr64 = COPY %4
109+
; ISEL-MIR-NEXT: STRXui %14, %0, 0 :: (store (p0) into %ir.dest)
110+
; ISEL-MIR-NEXT: RET_ReallyLR
111+
;
112+
; ISEL-ASM-LABEL: store_signed_const_local:
113+
; ISEL-ASM-NEXT: .cfi_startproc
114+
; ISEL-ASM-NEXT: mov x8, x0
115+
; ISEL-ASM-NEXT: movk x8, #1234, lsl #48
116+
; ISEL-ASM-ELF-NEXT: adrp x16, const_table_local
117+
; ISEL-ASM-ELF-NEXT: add x16, x16, :lo12:const_table_local
118+
; ISEL-ASM-MACHO-NEXT: adrp x16, _const_table_local@PAGE
119+
; ISEL-ASM-MACHO-NEXT: add x16, x16, _const_table_local@PAGEOFF
120+
; ISEL-ASM-NEXT: add x16, x16, #8
121+
; ISEL-ASM-NEXT: pacda x16, x8
122+
; ISEL-ASM-NEXT: str x16, [x0]
123+
; ISEL-ASM-NEXT: ret
105124
%dest.i = ptrtoint ptr %dest to i64
106125
%discr = call i64 @llvm.ptrauth.blend(i64 %dest.i, i64 1234)
107126
%signed.i = call i64 @llvm.ptrauth.sign(i64 ptrtoint (ptr getelementptr ([2 x ptr], ptr @const_table_local, i32 0, i32 1) to i64), i32 2, i64 %discr)
@@ -111,18 +130,37 @@ define void @store_signed_const_local(ptr %dest) {
111130
}
112131

113132
define void @store_signed_const_got(ptr %dest) {
114-
; ISEL-ELF-LABEL: name: store_signed_const_got
115-
; ISEL-ELF: body:
116-
; ISEL-ELF: %0:gpr64common = COPY $x0
117-
; ISEL-ELF-NEXT: %7:gpr64common = LOADgotAUTH target-flags(aarch64-got) @const_table_got
118-
; ISEL-ELF-NEXT: %6:gpr64common = ADDXri %7, 8, 0
119-
; ISEL-ELF-NEXT: %2:gpr64common = PAUTH_BLEND %0, 1234
120-
; ISEL-ELF-NEXT: %12:gpr64noip = COPY %2
121-
; ISEL-ELF-NEXT: LOADgotPAC target-flags(aarch64-got) @const_table_got + 8, 2, %12, 0, implicit-def $x16, implicit-def $x17, implicit-def $nzcv
122-
; ISEL-ELF-NEXT: %4:gpr64 = COPY $x16
123-
; ISEL-ELF-NEXT: %10:gpr64 = COPY %4
124-
; ISEL-ELF-NEXT: STRXui %10, %0, 0 :: (store (p0) into %ir.dest)
125-
; ISEL-ELF-NEXT: RET_ReallyLR
133+
; ISEL-MIR-ELF-LABEL: name: store_signed_const_got
134+
; ISEL-MIR-ELF: body:
135+
; ISEL-MIR-ELF: %0:gpr64common = COPY $x0
136+
; ISEL-MIR-ELF-NEXT: %7:gpr64common = LOADgotAUTH target-flags(aarch64-got) @const_table_got
137+
; ISEL-MIR-ELF-NEXT: %6:gpr64common = ADDXri %7, 8, 0
138+
; ISEL-MIR-ELF-NEXT: %2:gpr64common = PAUTH_BLEND %0, 1234
139+
; ISEL-MIR-ELF-NEXT: %12:gpr64noip = COPY %2
140+
; ISEL-MIR-ELF-NEXT: LOADgotPAC target-flags(aarch64-got) @const_table_got + 8, 2, %12, 0, implicit-def $x16, implicit-def $x17, implicit-def $nzcv
141+
; ISEL-MIR-ELF-NEXT: %4:gpr64 = COPY $x16
142+
; ISEL-MIR-ELF-NEXT: %10:gpr64 = COPY %4
143+
; ISEL-MIR-ELF-NEXT: STRXui %10, %0, 0 :: (store (p0) into %ir.dest)
144+
; ISEL-MIR-ELF-NEXT: RET_ReallyLR
145+
;
146+
; ISEL-ASM-ELF-LABEL: store_signed_const_got:
147+
; ISEL-ASM-ELF-NEXT: .cfi_startproc
148+
; ISEL-ASM-ELF-NEXT: mov x8, x0
149+
; ISEL-ASM-ELF-NEXT: movk x8, #1234, lsl #48
150+
; ISEL-ASM-ELF-NEXT: adrp x17, :got_auth:const_table_got
151+
; ISEL-ASM-ELF-NEXT: add x17, x17, :got_auth_lo12:const_table_got
152+
; ISEL-ASM-ELF-NEXT: ldr x16, [x17]
153+
; ISEL-ASM-ELF-NEXT: autda x16, x17
154+
; ISEL-ASM-ELF-NEXT: mov x17, x16
155+
; ISEL-ASM-ELF-NEXT: xpacd x17
156+
; ISEL-ASM-ELF-NEXT: cmp x16, x17
157+
; ISEL-ASM-ELF-NEXT: b.eq .Lauth_success_0
158+
; ISEL-ASM-ELF-NEXT: brk #0xc472
159+
; ISEL-ASM-ELF-NEXT: .Lauth_success_0:
160+
; ISEL-ASM-ELF-NEXT: add x16, x16, #8
161+
; ISEL-ASM-ELF-NEXT: pacda x16, x8
162+
; ISEL-ASM-ELF-NEXT: str x16, [x0]
163+
; ISEL-ASM-ELF-NEXT: ret
126164
%dest.i = ptrtoint ptr %dest to i64
127165
%discr = call i64 @llvm.ptrauth.blend(i64 %dest.i, i64 1234)
128166
%signed.i = call i64 @llvm.ptrauth.sign(i64 ptrtoint (ptr getelementptr ([2 x ptr], ptr @const_table_got, i32 0, i32 1) to i64), i32 2, i64 %discr)
@@ -132,17 +170,26 @@ define void @store_signed_const_got(ptr %dest) {
132170
}
133171

134172
define void @store_signed_arg(ptr %dest, ptr %p) {
135-
; ISEL-LABEL: name: store_signed_arg
136-
; ISEL: body:
137-
; ISEL: %0:gpr64common = COPY $x0
138-
; ISEL-NEXT: %1:gpr64common = COPY $x1
139-
; ISEL-NEXT: %3:gpr64common = PAUTH_BLEND %0, 1234
140-
; ISEL-NEXT: %6:gpr64common = ADDXri %1, 8, 0
173+
; ISEL-MIR-LABEL: name: store_signed_arg
174+
; ISEL-MIR: body:
175+
; ISEL-MIR: %0:gpr64common = COPY $x0
176+
; ISEL-MIR-NEXT: %1:gpr64common = COPY $x1
177+
; ISEL-MIR-NEXT: %3:gpr64common = PAUTH_BLEND %0, 1234
178+
; ISEL-MIR-NEXT: %6:gpr64common = ADDXri %1, 8, 0
141179
; Check that no implicit defs are added to PACDA instruction.
142-
; ISEL-NEXT: %8:gpr64 = PACDA %6, %3{{$}}
143-
; ISEL-NEXT: %10:gpr64 = COPY %8
144-
; ISEL-NEXT: STRXui %10, %0, 0 :: (store (p0) into %ir.dest)
145-
; ISEL-NEXT: RET_ReallyLR
180+
; ISEL-MIR-NEXT: %8:gpr64 = PACDA %6, %3{{$}}
181+
; ISEL-MIR-NEXT: %10:gpr64 = COPY %8
182+
; ISEL-MIR-NEXT: STRXui %10, %0, 0 :: (store (p0) into %ir.dest)
183+
; ISEL-MIR-NEXT: RET_ReallyLR
184+
;
185+
; ISEL-ASM-LABEL: store_signed_arg:
186+
; ISEL-ASM-NEXT: .cfi_startproc
187+
; ISEL-ASM-NEXT: mov x8, x0
188+
; ISEL-ASM-NEXT: movk x8, #1234, lsl #48
189+
; ISEL-ASM-NEXT: add x9, x1, #8
190+
; ISEL-ASM-NEXT: pacda x9, x8
191+
; ISEL-ASM-NEXT: str x9, [x0]
192+
; ISEL-ASM-NEXT: ret
146193
%dest.i = ptrtoint ptr %dest to i64
147194
%discr = call i64 @llvm.ptrauth.blend(i64 %dest.i, i64 1234)
148195
%p.offset = getelementptr [2 x ptr], ptr %p, i32 0, i32 1

llvm/test/CodeGen/AArch64/ptrauth-constant-in-code.ll

Lines changed: 77 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,41 @@ define ptr @foo() {
7272
;--- finalize-isel.ll
7373

7474
; RUN: llc < finalize-isel.ll -mtriple aarch64-elf -mattr=+pauth -global-isel=0 \
75-
; RUN: -verify-machineinstrs -stop-after=finalize-isel | FileCheck --check-prefixes=ISEL,ISEL-ELF %s
75+
; RUN: -verify-machineinstrs -stop-after=finalize-isel | FileCheck --check-prefixes=ISEL-MIR,ISEL-MIR-ELF %s
7676
; RUN: llc < finalize-isel.ll -mtriple arm64-apple-ios -mattr=+pauth -global-isel=0 \
77-
; RUN: -verify-machineinstrs -stop-after=finalize-isel | FileCheck --check-prefixes=ISEL %s
77+
; RUN: -verify-machineinstrs -stop-after=finalize-isel | FileCheck --check-prefixes=ISEL-MIR %s
78+
; RUN: llc < finalize-isel.ll -mtriple aarch64-elf -mattr=+pauth -global-isel=0 \
79+
; RUN: -verify-machineinstrs -asm-verbose=0 | FileCheck --check-prefixes=ISEL-ASM,ISEL-ASM-ELF %s
80+
; RUN: llc < finalize-isel.ll -mtriple arm64-apple-ios -mattr=+pauth -global-isel=0 \
81+
; RUN: -verify-machineinstrs -asm-verbose=0 | FileCheck --check-prefixes=ISEL-ASM,ISEL-ASM-MACHO %s
7882

7983
@const_table_local = dso_local constant [3 x ptr] [ptr null, ptr null, ptr null]
8084
@const_table_got = constant [3 x ptr] [ptr null, ptr null, ptr null]
8185

8286
define void @store_signed_const_local(ptr %dest) {
83-
; ISEL-LABEL: name: store_signed_const_local
84-
; ISEL: body:
85-
; ISEL: %0:gpr64common = COPY $x0
86-
; ISEL-NEXT: %1:gpr64common = PAUTH_BLEND %0, 1234
87-
; ISEL-NEXT: %2:gpr64common = MOVaddr target-flags(aarch64-page) @const_table_local + 8, target-flags(aarch64-pageoff, aarch64-nc) @const_table_local + 8
88-
; ISEL-NEXT: %4:gpr64noip = COPY %1
89-
; ISEL-NEXT: MOVaddrPAC @const_table_local + 8, 2, %4, 0, implicit-def $x16, implicit-def $x17
90-
; ISEL-NEXT: %3:gpr64 = COPY $x16
91-
; ISEL-NEXT: STRXui killed %3, %0, 0 :: (store (s64) into %ir.dest)
92-
; ISEL-NEXT: RET_ReallyLR
87+
; ISEL-MIR-LABEL: name: store_signed_const_local
88+
; ISEL-MIR: body:
89+
; ISEL-MIR: %0:gpr64common = COPY $x0
90+
; ISEL-MIR-NEXT: %1:gpr64common = PAUTH_BLEND %0, 1234
91+
; ISEL-MIR-NEXT: %2:gpr64common = MOVaddr target-flags(aarch64-page) @const_table_local + 8, target-flags(aarch64-pageoff, aarch64-nc) @const_table_local + 8
92+
; ISEL-MIR-NEXT: %4:gpr64noip = COPY %1
93+
; ISEL-MIR-NEXT: MOVaddrPAC @const_table_local + 8, 2, %4, 0, implicit-def $x16, implicit-def $x17
94+
; ISEL-MIR-NEXT: %3:gpr64 = COPY $x16
95+
; ISEL-MIR-NEXT: STRXui killed %3, %0, 0 :: (store (s64) into %ir.dest)
96+
; ISEL-MIR-NEXT: RET_ReallyLR
97+
;
98+
; ISEL-ASM-LABEL: store_signed_const_local:
99+
; ISEL-ASM-NEXT: .cfi_startproc
100+
; ISEL-ASM-NEXT: mov x8, x0
101+
; ISEL-ASM-NEXT: movk x8, #1234, lsl #48
102+
; ISEL-ASM-ELF-NEXT: adrp x16, const_table_local
103+
; ISEL-ASM-ELF-NEXT: add x16, x16, :lo12:const_table_local
104+
; ISEL-ASM-MACHO-NEXT: adrp x16, _const_table_local@PAGE
105+
; ISEL-ASM-MACHO-NEXT: add x16, x16, _const_table_local@PAGEOFF
106+
; ISEL-ASM-NEXT: add x16, x16, #8
107+
; ISEL-ASM-NEXT: pacda x16, x8
108+
; ISEL-ASM-NEXT: str x16, [x0]
109+
; ISEL-ASM-NEXT: ret
93110
%dest.i = ptrtoint ptr %dest to i64
94111
%discr = call i64 @llvm.ptrauth.blend(i64 %dest.i, i64 1234)
95112
%signed.i = call i64 @llvm.ptrauth.sign(i64 ptrtoint (ptr getelementptr ([2 x ptr], ptr @const_table_local, i32 0, i32 1) to i64), i32 2, i64 %discr)
@@ -99,17 +116,36 @@ define void @store_signed_const_local(ptr %dest) {
99116
}
100117

101118
define void @store_signed_const_got(ptr %dest) {
102-
; ISEL-ELF-LABEL: name: store_signed_const_got
103-
; ISEL-ELF: body:
104-
; ISEL-ELF: %0:gpr64common = COPY $x0
105-
; ISEL-ELF-NEXT: %1:gpr64common = PAUTH_BLEND %0, 1234
106-
; ISEL-ELF-NEXT: %2:gpr64common = LOADgotAUTH target-flags(aarch64-got) @const_table_got, implicit-def dead $x16, implicit-def dead $x17, implicit-def dead $nzcv
107-
; ISEL-ELF-NEXT: %3:gpr64common = ADDXri killed %2, 8, 0
108-
; ISEL-ELF-NEXT: %5:gpr64noip = COPY %1
109-
; ISEL-ELF-NEXT: LOADgotPAC target-flags(aarch64-got) @const_table_got + 8, 2, %5, 0, implicit-def $x16, implicit-def $x17, implicit-def $nzcv
110-
; ISEL-ELF-NEXT: %4:gpr64 = COPY $x16
111-
; ISEL-ELF-NEXT: STRXui killed %4, %0, 0 :: (store (s64) into %ir.dest)
112-
; ISEL-ELF-NEXT: RET_ReallyLR
119+
; ISEL-MIR-ELF-LABEL: name: store_signed_const_got
120+
; ISEL-MIR-ELF: body:
121+
; ISEL-MIR-ELF: %0:gpr64common = COPY $x0
122+
; ISEL-MIR-ELF-NEXT: %1:gpr64common = PAUTH_BLEND %0, 1234
123+
; ISEL-MIR-ELF-NEXT: %2:gpr64common = LOADgotAUTH target-flags(aarch64-got) @const_table_got, implicit-def dead $x16, implicit-def dead $x17, implicit-def dead $nzcv
124+
; ISEL-MIR-ELF-NEXT: %3:gpr64common = ADDXri killed %2, 8, 0
125+
; ISEL-MIR-ELF-NEXT: %5:gpr64noip = COPY %1
126+
; ISEL-MIR-ELF-NEXT: LOADgotPAC target-flags(aarch64-got) @const_table_got + 8, 2, %5, 0, implicit-def $x16, implicit-def $x17, implicit-def $nzcv
127+
; ISEL-MIR-ELF-NEXT: %4:gpr64 = COPY $x16
128+
; ISEL-MIR-ELF-NEXT: STRXui killed %4, %0, 0 :: (store (s64) into %ir.dest)
129+
; ISEL-MIR-ELF-NEXT: RET_ReallyLR
130+
;
131+
; ISEL-ASM-ELF-LABEL: store_signed_const_got:
132+
; ISEL-ASM-ELF-NEXT: .cfi_startproc
133+
; ISEL-ASM-ELF-NEXT: mov x8, x0
134+
; ISEL-ASM-ELF-NEXT: movk x8, #1234, lsl #48
135+
; ISEL-ASM-ELF-NEXT: adrp x17, :got_auth:const_table_got
136+
; ISEL-ASM-ELF-NEXT: add x17, x17, :got_auth_lo12:const_table_got
137+
; ISEL-ASM-ELF-NEXT: ldr x16, [x17]
138+
; ISEL-ASM-ELF-NEXT: autda x16, x17
139+
; ISEL-ASM-ELF-NEXT: mov x17, x16
140+
; ISEL-ASM-ELF-NEXT: xpacd x17
141+
; ISEL-ASM-ELF-NEXT: cmp x16, x17
142+
; ISEL-ASM-ELF-NEXT: b.eq .Lauth_success_0
143+
; ISEL-ASM-ELF-NEXT: brk #0xc472
144+
; ISEL-ASM-ELF-NEXT: .Lauth_success_0:
145+
; ISEL-ASM-ELF-NEXT: add x16, x16, #8
146+
; ISEL-ASM-ELF-NEXT: pacda x16, x8
147+
; ISEL-ASM-ELF-NEXT: str x16, [x0]
148+
; ISEL-ASM-ELF-NEXT: ret
113149
%dest.i = ptrtoint ptr %dest to i64
114150
%discr = call i64 @llvm.ptrauth.blend(i64 %dest.i, i64 1234)
115151
%signed.i = call i64 @llvm.ptrauth.sign(i64 ptrtoint (ptr getelementptr ([2 x ptr], ptr @const_table_got, i32 0, i32 1) to i64), i32 2, i64 %discr)
@@ -119,16 +155,25 @@ define void @store_signed_const_got(ptr %dest) {
119155
}
120156

121157
define void @store_signed_arg(ptr %dest, ptr %p) {
122-
; ISEL-LABEL: name: store_signed_arg
123-
; ISEL: body:
124-
; ISEL: %1:gpr64common = COPY $x1
125-
; ISEL-NEXT: %0:gpr64common = COPY $x0
126-
; ISEL-NEXT: %2:gpr64common = PAUTH_BLEND %0, 1234
127-
; ISEL-NEXT: %3:gpr64common = ADDXri %1, 8, 0
158+
; ISEL-MIR-LABEL: name: store_signed_arg
159+
; ISEL-MIR: body:
160+
; ISEL-MIR: %1:gpr64common = COPY $x1
161+
; ISEL-MIR-NEXT: %0:gpr64common = COPY $x0
162+
; ISEL-MIR-NEXT: %2:gpr64common = PAUTH_BLEND %0, 1234
163+
; ISEL-MIR-NEXT: %3:gpr64common = ADDXri %1, 8, 0
128164
; Check that no implicit defs are added to PACDA instruction.
129-
; ISEL-NEXT: %4:gpr64 = PACDA %3, killed %2{{$}}
130-
; ISEL-NEXT: STRXui killed %4, %0, 0 :: (store (s64) into %ir.dest)
131-
; ISEL-NEXT: RET_ReallyLR
165+
; ISEL-MIR-NEXT: %4:gpr64 = PACDA %3, killed %2{{$}}
166+
; ISEL-MIR-NEXT: STRXui killed %4, %0, 0 :: (store (s64) into %ir.dest)
167+
; ISEL-MIR-NEXT: RET_ReallyLR
168+
;
169+
; ISEL-ASM-LABEL: store_signed_arg:
170+
; ISEL-ASM-NEXT: .cfi_startproc
171+
; ISEL-ASM-NEXT: mov x8, x0
172+
; ISEL-ASM-NEXT: movk x8, #1234, lsl #48
173+
; ISEL-ASM-NEXT: add x9, x1, #8
174+
; ISEL-ASM-NEXT: pacda x9, x8
175+
; ISEL-ASM-NEXT: str x9, [x0]
176+
; ISEL-ASM-NEXT: ret
132177
%dest.i = ptrtoint ptr %dest to i64
133178
%discr = call i64 @llvm.ptrauth.blend(i64 %dest.i, i64 1234)
134179
%p.offset = getelementptr [2 x ptr], ptr %p, i32 0, i32 1

llvm/test/CodeGen/AArch64/ptrauth-tiny-model-pic.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ define dso_preemptable void @foo1() {
3434
; TRAP-NEXT: brk #0xc472
3535
; TRAP-NEXT: .Lauth_success_0:
3636
; TRAP-NEXT: mov x8, x16
37-
; CHECK-NEXT: ldrb w8, [x8]
3837
; CHECK-NEXT: adr x17, :got_auth:dst
3938
; NOTRAP-NEXT: ldr x9, [x17]
4039
; NOTRAP-NEXT: autda x9, x17
@@ -47,6 +46,7 @@ define dso_preemptable void @foo1() {
4746
; TRAP-NEXT: brk #0xc472
4847
; TRAP-NEXT: .Lauth_success_1:
4948
; TRAP-NEXT: mov x9, x16
49+
; CHECK-NEXT: ldrb w8, [x8]
5050
; CHECK-NEXT: strb w8, [x9]
5151
; CHECK-NEXT: ret
5252

@@ -106,7 +106,6 @@ define dso_preemptable void @foo3() {
106106
; TRAP-NEXT: brk #0xc472
107107
; TRAP-NEXT: .Lauth_success_4:
108108
; TRAP-NEXT: mov x8, x16
109-
; CHECK-NEXT: ldrb w8, [x8]
110109
; CHECK-NEXT: adr x17, :got_auth:ptr
111110
; NOTRAP-NEXT: ldr x9, [x17]
112111
; NOTRAP-NEXT: autda x9, x17
@@ -119,6 +118,7 @@ define dso_preemptable void @foo3() {
119118
; TRAP-NEXT: brk #0xc472
120119
; TRAP-NEXT: .Lauth_success_5:
121120
; TRAP-NEXT: mov x9, x16
121+
; CHECK-NEXT: ldrb w8, [x8]
122122
; CHECK-NEXT: ldr x9, [x9]
123123
; CHECK-NEXT: strb w8, [x9]
124124
; CHECK-NEXT: ret

llvm/test/CodeGen/AArch64/ptrauth-tiny-model-static.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ define dso_local void @foo1() {
3434
; TRAP-NEXT: brk #0xc472
3535
; TRAP-NEXT: .Lauth_success_0:
3636
; TRAP-NEXT: mov x8, x16
37-
; CHECK-NEXT: ldrb w8, [x8]
3837
; CHECK-NEXT: adr x17, :got_auth:dst
3938
; NOTRAP-NEXT: ldr x9, [x17]
4039
; NOTRAP-NEXT: autda x9, x17
@@ -47,6 +46,7 @@ define dso_local void @foo1() {
4746
; TRAP-NEXT: brk #0xc472
4847
; TRAP-NEXT: .Lauth_success_1:
4948
; TRAP-NEXT: mov x9, x16
49+
; CHECK-NEXT: ldrb w8, [x8]
5050
; CHECK-NEXT: strb w8, [x9]
5151
; CHECK-NEXT: ret
5252

@@ -106,7 +106,6 @@ define dso_local void @foo3() {
106106
; TRAP-NEXT: brk #0xc472
107107
; TRAP-NEXT: .Lauth_success_4:
108108
; TRAP-NEXT: mov x8, x16
109-
; CHECK-NEXT: ldrb w8, [x8]
110109
; CHECK-NEXT: adr x17, :got_auth:ptr
111110
; NOTRAP-NEXT: ldr x9, [x17]
112111
; NOTRAP-NEXT: autda x9, x17
@@ -119,6 +118,7 @@ define dso_local void @foo3() {
119118
; TRAP-NEXT: brk #0xc472
120119
; TRAP-NEXT: .Lauth_success_5:
121120
; TRAP-NEXT: mov x9, x16
121+
; CHECK-NEXT: ldrb w8, [x8]
122122
; CHECK-NEXT: ldr x9, [x9]
123123
; CHECK-NEXT: strb w8, [x9]
124124
; CHECK-NEXT: ret

0 commit comments

Comments
 (0)