Skip to content

Commit 1d8c8f1

Browse files
committed
[X86] cfguard - replace X32 check prefixes with X86
We try to only use X32 for gnux32 triple tests.
1 parent 824d073 commit 1d8c8f1

File tree

4 files changed

+78
-79
lines changed

4 files changed

+78
-79
lines changed

llvm/test/CodeGen/X86/cfguard-checks-funclet.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
1+
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X86
22
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s -check-prefixes=X64
33
; Control Flow Guard is currently only available on Windows
44

@@ -48,9 +48,9 @@ catch:
4848
try.cont:
4949
ret i32 0
5050

51-
; X32-LABEL: func_cf_exception
52-
; X32: calll *___guard_check_icall_fptr
53-
; X32-NEXT: calll *%ecx
51+
; X86-LABEL: func_cf_exception
52+
; X86: calll *___guard_check_icall_fptr
53+
; X86-NEXT: calll *%ecx
5454

5555
; X64-LABEL: func_cf_exception
5656
; X64: callq *__guard_dispatch_icall_fptr(%rip)

llvm/test/CodeGen/X86/cfguard-checks.ll

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
1+
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X86
22
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s -check-prefixes=X64,X64_MSVC
3-
; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefixes=X32,X32_MINGW
3+
; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefixes=X86,X86_MINGW
44
; RUN: llc < %s -mtriple=x86_64-w64-windows-gnu | FileCheck %s -check-prefixes=X64,X64_MINGW
55
; Control Flow Guard is currently only available on Windows
66

@@ -19,10 +19,10 @@ entry:
1919
%1 = call i32 %0() #0
2020
ret i32 %1
2121

22-
; X32-LABEL: func_guard_nocf
23-
; X32: movl $_target_func, %eax
24-
; X32-NOT: __guard_check_icall_fptr
25-
; X32: calll *%eax
22+
; X86-LABEL: func_guard_nocf
23+
; X86: movl $_target_func, %eax
24+
; X86-NOT: __guard_check_icall_fptr
25+
; X86: calll *%eax
2626

2727
; X64-LABEL: func_guard_nocf
2828
; X64: leaq target_func(%rip), %rax
@@ -43,12 +43,12 @@ entry:
4343
ret i32 %1
4444

4545
; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
46-
; X32-LABEL: func_optnone_cf
47-
; X32: leal _target_func, %eax
48-
; X32: movl %eax, (%esp)
49-
; X32: movl (%esp), %ecx
50-
; X32: calll *___guard_check_icall_fptr
51-
; X32-NEXT: calll *%ecx
46+
; X86-LABEL: func_optnone_cf
47+
; X86: leal _target_func, %eax
48+
; X86: movl %eax, (%esp)
49+
; X86: movl (%esp), %ecx
50+
; X86: calll *___guard_check_icall_fptr
51+
; X86-NEXT: calll *%ecx
5252

5353
; On x86_64, __guard_dispatch_icall_fptr tail calls the function, so there should be only one call instruction.
5454
; X64-LABEL: func_optnone_cf
@@ -70,11 +70,11 @@ entry:
7070
ret i32 %1
7171

7272
; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
73-
; X32-LABEL: func_cf
74-
; X32: movl $_target_func, %esi
75-
; X32: movl $_target_func, %ecx
76-
; X32: calll *___guard_check_icall_fptr
77-
; X32-NEXT: calll *%esi
73+
; X86-LABEL: func_cf
74+
; X86: movl $_target_func, %esi
75+
; X86: movl $_target_func, %ecx
76+
; X86: calll *___guard_check_icall_fptr
77+
; X86-NEXT: calll *%esi
7878

7979
; On x86_64, __guard_dispatch_icall_fptr tail calls the function, so there should be only one call instruction.
8080
; X64-LABEL: func_cf
@@ -102,14 +102,14 @@ lpad: ; preds = %entry
102102
ret i32 -1
103103

104104
; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
105-
; X32-LABEL: func_cf_invoke
106-
; X32: movl $_target_func, %esi
107-
; X32: movl $_target_func, %ecx
108-
; X32: calll *___guard_check_icall_fptr
109-
; X32_MINGW-NEXT: Ltmp0:
110-
; X32-NEXT: calll *%esi
111-
; X32: # %invoke.cont
112-
; X32: # %lpad
105+
; X86-LABEL: func_cf_invoke
106+
; X86: movl $_target_func, %esi
107+
; X86: movl $_target_func, %ecx
108+
; X86: calll *___guard_check_icall_fptr
109+
; X86_MINGW-NEXT: Ltmp0:
110+
; X86-NEXT: calll *%esi
111+
; X86: # %invoke.cont
112+
; X86: # %lpad
113113

114114
; On x86_64, __guard_dispatch_icall_fptr tail calls the function, so there should be only one call instruction.
115115
; X64-LABEL: func_cf_invoke
@@ -135,11 +135,11 @@ entry:
135135
ret double %1
136136

137137
; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
138-
; X32-LABEL: func_cf_doubles
139-
; X32: movl $_target_func_doubles, %esi
140-
; X32: movl $_target_func_doubles, %ecx
141-
; X32: calll *___guard_check_icall_fptr
142-
; X32: calll *%esi
138+
; X86-LABEL: func_cf_doubles
139+
; X86: movl $_target_func_doubles, %esi
140+
; X86: movl $_target_func_doubles, %ecx
141+
; X86: calll *___guard_check_icall_fptr
142+
; X86: calll *%esi
143143

144144

145145
; On x86_64, __guard_dispatch_icall_fptr tail calls the function, so there should be only one call instruction.
@@ -169,12 +169,12 @@ entry:
169169
ret i32 %1
170170

171171
; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
172-
; X32-LABEL: func_cf_tail
173-
; X32: movl $_target_func, %ecx
174-
; X32: calll *___guard_check_icall_fptr
175-
; X32: movl $_target_func, %eax
176-
; X32: jmpl *%eax # TAILCALL
177-
; X32-NOT: calll
172+
; X86-LABEL: func_cf_tail
173+
; X86: movl $_target_func, %ecx
174+
; X86: calll *___guard_check_icall_fptr
175+
; X86: movl $_target_func, %eax
176+
; X86: jmpl *%eax # TAILCALL
177+
; X86-NOT: calll
178178

179179
; X64-LABEL: func_cf_tail
180180
; X64: leaq target_func(%rip), %rax
@@ -197,14 +197,14 @@ entry:
197197
ret i32 %rv
198198

199199
; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
200-
; X32-LABEL: _vmptr_thunk:
201-
; X32: movl %eax, %esi
202-
; X32: movl (%eax), %eax
203-
; X32: movl 4(%eax), %ecx
204-
; X32: calll *___guard_check_icall_fptr
205-
; X32: movl %esi, %eax
206-
; X32: jmpl *%ecx # TAILCALL
207-
; X32-NOT: calll
200+
; X86-LABEL: _vmptr_thunk:
201+
; X86: movl %eax, %esi
202+
; X86: movl (%eax), %eax
203+
; X86: movl 4(%eax), %ecx
204+
; X86: calll *___guard_check_icall_fptr
205+
; X86: movl %esi, %eax
206+
; X86: jmpl *%ecx # TAILCALL
207+
; X86-NOT: calll
208208

209209
; Use NEXT here because we previously had an extra instruction in this sequence.
210210
; X64-LABEL: vmptr_thunk:
@@ -227,9 +227,9 @@ define i32 @func_cf_setjmp() {
227227
%3 = call ptr @llvm.frameaddress(i32 0)
228228
%4 = call i32 @_setjmp(ptr @buf1, ptr %3) #2
229229

230-
; X32-LABEL: func_cf_setjmp
231-
; X32: calll __setjmp
232-
; X32-NEXT: $cfgsj_func_cf_setjmp0:
230+
; X86-LABEL: func_cf_setjmp
231+
; X86: calll __setjmp
232+
; X86-NEXT: $cfgsj_func_cf_setjmp0:
233233

234234
; X64-LABEL: func_cf_setjmp
235235
; X64: callq _setjmp
@@ -238,8 +238,8 @@ define i32 @func_cf_setjmp() {
238238
%5 = call ptr @llvm.frameaddress(i32 0)
239239
%6 = call i32 @_setjmp(ptr @buf1, ptr %5) #2
240240

241-
; X32: calll __setjmp
242-
; X32-NEXT: $cfgsj_func_cf_setjmp1:
241+
; X86: calll __setjmp
242+
; X86-NEXT: $cfgsj_func_cf_setjmp1:
243243

244244
; X64: callq _setjmp
245245
; X64-NEXT: $cfgsj_func_cf_setjmp1:
@@ -248,9 +248,9 @@ define i32 @func_cf_setjmp() {
248248
%7 = load i32, ptr %2, align 4
249249
ret i32 %7
250250

251-
; X32: .section .gljmp$y,"dr"
252-
; X32-NEXT: .symidx $cfgsj_func_cf_setjmp0
253-
; X32-NEXT: .symidx $cfgsj_func_cf_setjmp1
251+
; X86: .section .gljmp$y,"dr"
252+
; X86-NEXT: .symidx $cfgsj_func_cf_setjmp0
253+
; X86-NEXT: .symidx $cfgsj_func_cf_setjmp1
254254

255255
; X64: .section .gljmp$y,"dr"
256256
; X64-NEXT: .symidx $cfgsj_func_cf_setjmp0

llvm/test/CodeGen/X86/cfguard-module-flag.ll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
2-
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
1+
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X86
32
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s -check-prefix=X64
4-
; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X32
3+
; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X86
54
; RUN: llc < %s -mtriple=x86_64-w64-windows-gnu | FileCheck %s -check-prefix=X64
65
; Control Flow Guard is currently only available on Windows
76

@@ -20,7 +19,7 @@ entry:
2019
call void %0()
2120
ret void
2221

23-
; X32-NOT: __guard_check_icall_fptr
22+
; X86-NOT: __guard_check_icall_fptr
2423
; X64-NOT: __guard_dispatch_icall_fptr
2524
}
2625

llvm/test/CodeGen/X86/cfguard-x86-vectorcall.ll

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
2-
; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X32
1+
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X86
2+
; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X86
33
; Control Flow Guard is currently only available on Windows
44

55

@@ -12,23 +12,23 @@ entry:
1212
call x86_vectorcallcc void %0(%struct.HVA inreg %3)
1313
ret void
1414

15-
; X32-LABEL: func_cf_vector_x86
16-
; X32: movl 12(%ebp), %eax
17-
; X32: movl 8(%ebp), %ecx
18-
; X32: movsd 24(%eax), %xmm4 # xmm4 = mem[0],zero
19-
; X32: movsd %xmm4, 24(%esp)
20-
; X32: movsd 16(%eax), %xmm5 # xmm5 = mem[0],zero
21-
; X32: movsd %xmm5, 16(%esp)
22-
; X32: movsd (%eax), %xmm6 # xmm6 = mem[0],zero
23-
; X32: movsd 8(%eax), %xmm7 # xmm7 = mem[0],zero
24-
; X32: movsd %xmm7, 8(%esp)
25-
; X32: movsd %xmm6, (%esp)
26-
; X32: calll *___guard_check_icall_fptr
27-
; X32: movaps %xmm6, %xmm0
28-
; X32: movaps %xmm7, %xmm1
29-
; X32: movaps %xmm5, %xmm2
30-
; X32: movaps %xmm4, %xmm3
31-
; X32: calll *%ecx
15+
; X86-LABEL: func_cf_vector_x86
16+
; X86: movl 12(%ebp), %eax
17+
; X86: movl 8(%ebp), %ecx
18+
; X86: movsd 24(%eax), %xmm4 # xmm4 = mem[0],zero
19+
; X86: movsd %xmm4, 24(%esp)
20+
; X86: movsd 16(%eax), %xmm5 # xmm5 = mem[0],zero
21+
; X86: movsd %xmm5, 16(%esp)
22+
; X86: movsd (%eax), %xmm6 # xmm6 = mem[0],zero
23+
; X86: movsd 8(%eax), %xmm7 # xmm7 = mem[0],zero
24+
; X86: movsd %xmm7, 8(%esp)
25+
; X86: movsd %xmm6, (%esp)
26+
; X86: calll *___guard_check_icall_fptr
27+
; X86: movaps %xmm6, %xmm0
28+
; X86: movaps %xmm7, %xmm1
29+
; X86: movaps %xmm5, %xmm2
30+
; X86: movaps %xmm4, %xmm3
31+
; X86: calll *%ecx
3232
}
3333
attributes #0 = { "target-cpu"="pentium4" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" }
3434

0 commit comments

Comments
 (0)