1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc < %s | FileCheck %s
4 target triple = "aarch64--linux-android"
6 define ptr @f1(ptr %x0, ptr %x1) {
9 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
10 ; CHECK-NEXT: .cfi_def_cfa_offset 16
11 ; CHECK-NEXT: .cfi_offset w30, -16
12 ; CHECK-NEXT: bl __hwasan_check_x1_1_fixed_4398046511104
13 ; CHECK-NEXT: mov x0, x1
14 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
16 call void @llvm.hwasan.check.memaccess.fixedshadow(ptr %x1, i32 1, i64 4398046511104)
20 define ptr @f2(ptr %x0, ptr %x1) {
23 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
24 ; CHECK-NEXT: .cfi_def_cfa_offset 16
25 ; CHECK-NEXT: .cfi_offset w30, -16
26 ; CHECK-NEXT: bl __hwasan_check_x0_2_fixed_4398046511104_short_v2
27 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
29 call void @llvm.hwasan.check.memaccess.shortgranules.fixedshadow(ptr %x0, i32 2, i64 4398046511104)
33 define void @f3(ptr %x0, ptr %x1) {
34 ; 0x3ff0000 (kernel, match-all = 0xff)
37 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
38 ; CHECK-NEXT: .cfi_def_cfa_offset 16
39 ; CHECK-NEXT: .cfi_offset w30, -16
40 ; CHECK-NEXT: bl __hwasan_check_x1_67043328_fixed_4398046511104
41 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
43 call void @llvm.hwasan.check.memaccess.fixedshadow(ptr %x1, i32 67043328, i64 4398046511104)
47 define void @f4(ptr %x0, ptr %x1) {
48 ; 0x1000010 (access-size-index = 0, is-write = 1, match-all = 0x0)
51 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
52 ; CHECK-NEXT: .cfi_def_cfa_offset 16
53 ; CHECK-NEXT: .cfi_offset w30, -16
54 ; CHECK-NEXT: bl __hwasan_check_x1_16777232_fixed_4398046511104_short_v2
55 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
57 call void @llvm.hwasan.check.memaccess.shortgranules.fixedshadow(ptr %x1, i32 16777232, i64 4398046511104)
61 declare void @llvm.hwasan.check.memaccess.fixedshadow(ptr, i32, i64)
62 declare void @llvm.hwasan.check.memaccess.shortgranules.fixedshadow(ptr, i32, i64)
64 ; CHECK: .section .text.hot,"axG",@progbits,__hwasan_check_x0_2_fixed_4398046511104_short_v2,comdat
65 ; CHECK-NEXT: .type __hwasan_check_x0_2_fixed_4398046511104_short_v2,@function
66 ; CHECK-NEXT: .weak __hwasan_check_x0_2_fixed_4398046511104_short_v2
67 ; CHECK-NEXT: .hidden __hwasan_check_x0_2_fixed_4398046511104_short_v2
68 ; CHECK-NEXT: __hwasan_check_x0_2_fixed_4398046511104_short_v2:
69 ; CHECK-NEXT: sbfx x16, x0, #4, #52
70 ; CHECK-NEXT: mov x17, #4398046511104
71 ; CHECK-NEXT: ldrb w16, [x17, x16]
72 ; CHECK-NEXT: cmp x16, x0, lsr #56
73 ; CHECK-NEXT: b.ne .Ltmp0
77 ; CHECK-NEXT: cmp w16, #15
78 ; CHECK-NEXT: b.hi .Ltmp2
79 ; CHECK-NEXT: and x17, x0, #0xf
80 ; CHECK-NEXT: add x17, x17, #3
81 ; CHECK-NEXT: cmp w16, w17
82 ; CHECK-NEXT: b.ls .Ltmp2
83 ; CHECK-NEXT: orr x16, x0, #0xf
84 ; CHECK-NEXT: ldrb w16, [x16]
85 ; CHECK-NEXT: cmp x16, x0, lsr #56
86 ; CHECK-NEXT: b.eq .Ltmp1
88 ; CHECK-NEXT: stp x0, x1, [sp, #-256]!
89 ; CHECK-NEXT: stp x29, x30, [sp, #232]
90 ; CHECK-NEXT: mov x1, #2
91 ; CHECK-NEXT: adrp x16, :got:__hwasan_tag_mismatch_v2
92 ; CHECK-NEXT: ldr x16, [x16, :got_lo12:__hwasan_tag_mismatch_v2]
96 ; CHECK: .section .text.hot,"axG",@progbits,__hwasan_check_x1_1_fixed_4398046511104,comdat
97 ; CHECK-NEXT: .type __hwasan_check_x1_1_fixed_4398046511104,@function
98 ; CHECK-NEXT: .weak __hwasan_check_x1_1_fixed_4398046511104
99 ; CHECK-NEXT: .hidden __hwasan_check_x1_1_fixed_4398046511104
100 ; CHECK-NEXT: __hwasan_check_x1_1_fixed_4398046511104:
101 ; CHECK-NEXT: sbfx x16, x1, #4, #52
102 ; CHECK-NEXT: mov x17, #4398046511104
103 ; CHECK-NEXT: ldrb w16, [x17, x16]
104 ; CHECK-NEXT: cmp x16, x1, lsr #56
105 ; CHECK-NEXT: b.ne .Ltmp3
106 ; CHECK-NEXT: .Ltmp4:
108 ; CHECK-NEXT: .Ltmp3:
109 ; CHECK-NEXT: stp x0, x1, [sp, #-256]!
110 ; CHECK-NEXT: stp x29, x30, [sp, #232]
111 ; CHECK-NEXT: mov x0, x1
112 ; CHECK-NEXT: mov x1, #1
113 ; CHECK-NEXT: adrp x16, :got:__hwasan_tag_mismatch
114 ; CHECK-NEXT: ldr x16, [x16, :got_lo12:__hwasan_tag_mismatch]
117 ; CHECK: __hwasan_check_x1_67043328_fixed_4398046511104:
118 ; CHECK-NEXT: sbfx x16, x1, #4, #52
119 ; CHECK-NEXT: mov x17, #4398046511104
120 ; CHECK-NEXT: ldrb w16, [x17, x16]
121 ; CHECK-NEXT: cmp x16, x1, lsr #56
122 ; CHECK-NEXT: b.ne .Ltmp5
123 ; CHECK-NEXT: .Ltmp6:
125 ; CHECK-NEXT: .Ltmp5:
126 ; CHECK-NEXT: lsr x17, x1, #56
127 ; CHECK-NEXT: cmp x17, #255
128 ; CHECK-NEXT: b.eq .Ltmp6
129 ; CHECK-NEXT: stp x0, x1, [sp, #-256]!
130 ; CHECK-NEXT: stp x29, x30, [sp, #232]
131 ; CHECK-NEXT: mov x0, x1
132 ; CHECK-NEXT: mov x1, #0
133 ; CHECK-NEXT: b __hwasan_tag_mismatch
135 ; CHECK: __hwasan_check_x1_16777232_fixed_4398046511104_short_v2:
136 ; CHECK-NEXT: sbfx x16, x1, #4, #52
137 ; CHECK-NEXT: mov x17, #4398046511104
138 ; CHECK-NEXT: ldrb w16, [x17, x16]
139 ; CHECK-NEXT: cmp x16, x1, lsr #56
140 ; CHECK-NEXT: b.ne .Ltmp7
141 ; CHECK-NEXT: .Ltmp8:
143 ; CHECK-NEXT: .Ltmp7:
144 ; CHECK-NEXT: lsr x17, x1, #56
145 ; CHECK-NEXT: cmp x17, #0
146 ; CHECK-NEXT: b.eq .Ltmp8
147 ; CHECK-NEXT: cmp w16, #15
148 ; CHECK-NEXT: b.hi .Ltmp9
149 ; CHECK-NEXT: and x17, x1, #0xf
150 ; CHECK-NEXT: cmp w16, w17
151 ; CHECK-NEXT: b.ls .Ltmp9
152 ; CHECK-NEXT: orr x16, x1, #0xf
153 ; CHECK-NEXT: ldrb w16, [x16]
154 ; CHECK-NEXT: cmp x16, x1, lsr #56
155 ; CHECK-NEXT: b.eq .Ltmp8
156 ; CHECK-NEXT: .Ltmp9:
157 ; CHECK-NEXT: stp x0, x1, [sp, #-256]!
158 ; CHECK-NEXT: stp x29, x30, [sp, #232]
159 ; CHECK-NEXT: mov x0, x1
160 ; CHECK-NEXT: mov x1, #16
161 ; CHECK-NEXT: adrp x16, :got:__hwasan_tag_mismatch_v2
162 ; CHECK-NEXT: ldr x16, [x16, :got_lo12:__hwasan_tag_mismatch_v2]