[llvm] 1d8c8f1 - [X86] cfguard - replace X32 check prefixes with X86

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 04:09:12 PST 2024


Author: Simon Pilgrim
Date: 2024-01-31T12:05:32Z
New Revision: 1d8c8f11699ef03e8cc299245a16b2bd141b2ba7

URL: https://github.com/llvm/llvm-project/commit/1d8c8f11699ef03e8cc299245a16b2bd141b2ba7
DIFF: https://github.com/llvm/llvm-project/commit/1d8c8f11699ef03e8cc299245a16b2bd141b2ba7.diff

LOG: [X86] cfguard - replace X32 check prefixes with X86

We try to only use X32 for gnux32 triple tests.

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/cfguard-checks-funclet.ll
    llvm/test/CodeGen/X86/cfguard-checks.ll
    llvm/test/CodeGen/X86/cfguard-module-flag.ll
    llvm/test/CodeGen/X86/cfguard-x86-vectorcall.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/cfguard-checks-funclet.ll b/llvm/test/CodeGen/X86/cfguard-checks-funclet.ll
index 4466882dbfe55..fa7388e9e59d2 100644
--- a/llvm/test/CodeGen/X86/cfguard-checks-funclet.ll
+++ b/llvm/test/CodeGen/X86/cfguard-checks-funclet.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
+; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X86
 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s -check-prefixes=X64
 ; Control Flow Guard is currently only available on Windows
 
@@ -48,9 +48,9 @@ catch:
 try.cont:
   ret i32 0
 
-  ; X32-LABEL: func_cf_exception
-	; X32: 	     calll *___guard_check_icall_fptr
-	; X32-NEXT:  calll *%ecx
+  ; X86-LABEL: func_cf_exception
+  ; X86:         calll *___guard_check_icall_fptr
+  ; X86-NEXT:    calll *%ecx
 
   ; X64-LABEL: func_cf_exception
   ; X64:       callq *__guard_dispatch_icall_fptr(%rip)

diff  --git a/llvm/test/CodeGen/X86/cfguard-checks.ll b/llvm/test/CodeGen/X86/cfguard-checks.ll
index d3c1875fb4773..a727bbbfdcbe3 100644
--- a/llvm/test/CodeGen/X86/cfguard-checks.ll
+++ b/llvm/test/CodeGen/X86/cfguard-checks.ll
@@ -1,6 +1,6 @@
-; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
+; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X86
 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s -check-prefixes=X64,X64_MSVC
-; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefixes=X32,X32_MINGW
+; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefixes=X86,X86_MINGW
 ; RUN: llc < %s -mtriple=x86_64-w64-windows-gnu | FileCheck %s -check-prefixes=X64,X64_MINGW
 ; Control Flow Guard is currently only available on Windows
 
@@ -19,10 +19,10 @@ entry:
   %1 = call i32 %0() #0
   ret i32 %1
 
-  ; X32-LABEL: func_guard_nocf
-  ; X32: 	     movl  $_target_func, %eax
-  ; X32-NOT: __guard_check_icall_fptr
-	; X32: 	     calll *%eax
+  ; X86-LABEL: func_guard_nocf
+  ; X86:         movl  $_target_func, %eax
+  ; X86-NOT: __guard_check_icall_fptr
+  ; X86:         calll *%eax
 
   ; X64-LABEL: func_guard_nocf
   ; X64:       leaq	target_func(%rip), %rax
@@ -43,12 +43,12 @@ entry:
   ret i32 %1
 
   ; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
-  ; X32-LABEL: func_optnone_cf
-	; X32: 	     leal  _target_func, %eax
-	; X32: 	     movl  %eax, (%esp)
-	; X32: 	     movl  (%esp), %ecx
-	; X32: 	     calll *___guard_check_icall_fptr
-	; X32-NEXT:  calll *%ecx
+  ; X86-LABEL: func_optnone_cf
+  ; X86:         leal  _target_func, %eax
+  ; X86:         movl  %eax, (%esp)
+  ; X86:         movl  (%esp), %ecx
+  ; X86:         calll *___guard_check_icall_fptr
+  ; X86-NEXT:  calll *%ecx
 
   ; On x86_64, __guard_dispatch_icall_fptr tail calls the function, so there should be only one call instruction.
   ; X64-LABEL: func_optnone_cf
@@ -70,11 +70,11 @@ entry:
   ret i32 %1
 
   ; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
-  ; X32-LABEL: func_cf
-  ; X32: 	     movl  $_target_func, %esi
-	; X32: 	     movl  $_target_func, %ecx
-	; X32: 	     calll *___guard_check_icall_fptr
-	; X32-NEXT:  calll *%esi
+  ; X86-LABEL: func_cf
+  ; X86:         movl  $_target_func, %esi
+  ; X86:         movl  $_target_func, %ecx
+  ; X86:         calll *___guard_check_icall_fptr
+  ; X86-NEXT:  calll *%esi
 
   ; On x86_64, __guard_dispatch_icall_fptr tail calls the function, so there should be only one call instruction.
   ; X64-LABEL: func_cf
@@ -102,14 +102,14 @@ lpad:                                             ; preds = %entry
   ret i32 -1
 
   ; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
-  ; X32-LABEL: func_cf_invoke
-  ; X32: 	     movl  $_target_func, %esi
-	; X32: 	     movl  $_target_func, %ecx
-	; X32: 	     calll *___guard_check_icall_fptr
-  ; X32_MINGW-NEXT: Ltmp0:
-	; X32-NEXT:  calll *%esi
-  ; X32:       # %invoke.cont
-  ; X32:       # %lpad
+  ; X86-LABEL: func_cf_invoke
+  ; X86:         movl  $_target_func, %esi
+  ; X86:         movl  $_target_func, %ecx
+  ; X86:         calll *___guard_check_icall_fptr
+  ; X86_MINGW-NEXT: Ltmp0:
+  ; X86-NEXT:  calll *%esi
+  ; X86:       # %invoke.cont
+  ; X86:       # %lpad
 
   ; On x86_64, __guard_dispatch_icall_fptr tail calls the function, so there should be only one call instruction.
   ; X64-LABEL: func_cf_invoke
@@ -135,11 +135,11 @@ entry:
   ret double %1
 
   ; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
-  ; X32-LABEL: func_cf_doubles
-  ; X32: 	     movl  $_target_func_doubles, %esi
-	; X32: 	     movl  $_target_func_doubles, %ecx
-	; X32: 	     calll *___guard_check_icall_fptr
-	; X32:       calll *%esi
+  ; X86-LABEL: func_cf_doubles
+  ; X86:         movl  $_target_func_doubles, %esi
+  ; X86:         movl  $_target_func_doubles, %ecx
+  ; X86:         calll *___guard_check_icall_fptr
+  ; X86:         calll *%esi
 
 
   ; On x86_64, __guard_dispatch_icall_fptr tail calls the function, so there should be only one call instruction.
@@ -169,12 +169,12 @@ entry:
   ret i32 %1
 
   ; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
-  ; X32-LABEL: func_cf_tail
-	; X32: 	     movl  $_target_func, %ecx
-	; X32: 	     calll *___guard_check_icall_fptr
-  ; X32:       movl $_target_func, %eax
-	; X32:       jmpl	*%eax                  # TAILCALL
-  ; X32-NOT:   calll
+  ; X86-LABEL: func_cf_tail
+  ; X86:         movl  $_target_func, %ecx
+  ; X86:         calll *___guard_check_icall_fptr
+  ; X86:         movl $_target_func, %eax
+  ; X86:         jmpl	*%eax                  # TAILCALL
+  ; X86-NOT:   calll
 
   ; X64-LABEL: func_cf_tail
   ; X64:       leaq	target_func(%rip), %rax
@@ -197,14 +197,14 @@ entry:
   ret i32 %rv
 
   ; On i686, the call to __guard_check_icall_fptr should come immediately before the call to the target function.
-  ; X32-LABEL: _vmptr_thunk:
-  ; X32:       movl %eax, %esi
-  ; X32:       movl (%eax), %eax
-  ; X32:       movl 4(%eax), %ecx
-  ; X32:       calll *___guard_check_icall_fptr
-  ; X32:       movl %esi, %eax
-  ; X32:       jmpl       *%ecx                  # TAILCALL
-  ; X32-NOT:   calll
+  ; X86-LABEL: _vmptr_thunk:
+  ; X86:       movl %eax, %esi
+  ; X86:       movl (%eax), %eax
+  ; X86:       movl 4(%eax), %ecx
+  ; X86:       calll *___guard_check_icall_fptr
+  ; X86:       movl %esi, %eax
+  ; X86:       jmpl       *%ecx                  # TAILCALL
+  ; X86-NOT:   calll
 
   ; Use NEXT here because we previously had an extra instruction in this sequence.
   ; X64-LABEL: vmptr_thunk:
@@ -227,9 +227,9 @@ define i32 @func_cf_setjmp() {
   %3 = call ptr @llvm.frameaddress(i32 0)
   %4 = call i32 @_setjmp(ptr @buf1, ptr %3) #2
 
-  ; X32-LABEL: func_cf_setjmp
-  ; X32:       calll __setjmp
-  ; X32-NEXT:  $cfgsj_func_cf_setjmp0:
+  ; X86-LABEL: func_cf_setjmp
+  ; X86:       calll __setjmp
+  ; X86-NEXT:  $cfgsj_func_cf_setjmp0:
 
   ; X64-LABEL: func_cf_setjmp
   ; X64:       callq _setjmp
@@ -238,8 +238,8 @@ define i32 @func_cf_setjmp() {
   %5 = call ptr @llvm.frameaddress(i32 0)
   %6 = call i32 @_setjmp(ptr @buf1, ptr %5) #2
 
-  ; X32:       calll __setjmp
-  ; X32-NEXT:  $cfgsj_func_cf_setjmp1:
+  ; X86:       calll __setjmp
+  ; X86-NEXT:  $cfgsj_func_cf_setjmp1:
 
   ; X64:       callq _setjmp
   ; X64-NEXT:  $cfgsj_func_cf_setjmp1:
@@ -248,9 +248,9 @@ define i32 @func_cf_setjmp() {
   %7 = load i32, ptr %2, align 4
   ret i32 %7
 
-  ; X32:       .section .gljmp$y,"dr"
-  ; X32-NEXT:  .symidx $cfgsj_func_cf_setjmp0
-  ; X32-NEXT:  .symidx $cfgsj_func_cf_setjmp1
+  ; X86:       .section .gljmp$y,"dr"
+  ; X86-NEXT:  .symidx $cfgsj_func_cf_setjmp0
+  ; X86-NEXT:  .symidx $cfgsj_func_cf_setjmp1
 
   ; X64:       .section .gljmp$y,"dr"
   ; X64-NEXT:  .symidx $cfgsj_func_cf_setjmp0

diff  --git a/llvm/test/CodeGen/X86/cfguard-module-flag.ll b/llvm/test/CodeGen/X86/cfguard-module-flag.ll
index 4675c641d5e2e..f69eccfc3d282 100644
--- a/llvm/test/CodeGen/X86/cfguard-module-flag.ll
+++ b/llvm/test/CodeGen/X86/cfguard-module-flag.ll
@@ -1,7 +1,6 @@
-
-; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
+; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X86
 ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s -check-prefix=X64
-; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X32
+; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X86
 ; RUN: llc < %s -mtriple=x86_64-w64-windows-gnu | FileCheck %s -check-prefix=X64
 ; Control Flow Guard is currently only available on Windows
 
@@ -20,7 +19,7 @@ entry:
   call void %0()
   ret void
 
-  ; X32-NOT: __guard_check_icall_fptr
+  ; X86-NOT: __guard_check_icall_fptr
   ; X64-NOT: __guard_dispatch_icall_fptr
 }
 

diff  --git a/llvm/test/CodeGen/X86/cfguard-x86-vectorcall.ll b/llvm/test/CodeGen/X86/cfguard-x86-vectorcall.ll
index ca5fe4f876d4a..a75973310d15c 100644
--- a/llvm/test/CodeGen/X86/cfguard-x86-vectorcall.ll
+++ b/llvm/test/CodeGen/X86/cfguard-x86-vectorcall.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
-; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X32
+; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X86
+; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X86
 ; Control Flow Guard is currently only available on Windows
 
 
@@ -12,23 +12,23 @@ entry:
   call x86_vectorcallcc void %0(%struct.HVA inreg %3)
   ret void
 
-  ; X32-LABEL: func_cf_vector_x86
-  ; X32: 	     movl 12(%ebp), %eax
-  ; X32: 	     movl 8(%ebp), %ecx
-  ; X32: 	     movsd 24(%eax), %xmm4         # xmm4 = mem[0],zero
-  ; X32: 	     movsd %xmm4, 24(%esp)
-  ; X32: 	     movsd 16(%eax), %xmm5         # xmm5 = mem[0],zero
-  ; X32: 	     movsd %xmm5, 16(%esp)
-  ; X32: 	     movsd (%eax), %xmm6           # xmm6 = mem[0],zero
-  ; X32: 	     movsd 8(%eax), %xmm7          # xmm7 = mem[0],zero
-  ; X32: 	     movsd %xmm7, 8(%esp)
-  ; X32: 	     movsd %xmm6, (%esp)
-  ; X32: 	     calll *___guard_check_icall_fptr
-  ; X32: 	     movaps %xmm6, %xmm0
-  ; X32: 	     movaps %xmm7, %xmm1
-  ; X32: 	     movaps %xmm5, %xmm2
-  ; X32: 	     movaps %xmm4, %xmm3
-  ; X32: 	     calll  *%ecx
+  ; X86-LABEL: func_cf_vector_x86
+  ; X86: 	     movl 12(%ebp), %eax
+  ; X86: 	     movl 8(%ebp), %ecx
+  ; X86: 	     movsd 24(%eax), %xmm4         # xmm4 = mem[0],zero
+  ; X86: 	     movsd %xmm4, 24(%esp)
+  ; X86: 	     movsd 16(%eax), %xmm5         # xmm5 = mem[0],zero
+  ; X86: 	     movsd %xmm5, 16(%esp)
+  ; X86: 	     movsd (%eax), %xmm6           # xmm6 = mem[0],zero
+  ; X86: 	     movsd 8(%eax), %xmm7          # xmm7 = mem[0],zero
+  ; X86: 	     movsd %xmm7, 8(%esp)
+  ; X86: 	     movsd %xmm6, (%esp)
+  ; X86: 	     calll *___guard_check_icall_fptr
+  ; X86: 	     movaps %xmm6, %xmm0
+  ; X86: 	     movaps %xmm7, %xmm1
+  ; X86: 	     movaps %xmm5, %xmm2
+  ; X86: 	     movaps %xmm4, %xmm3
+  ; X86: 	     calll  *%ecx
 }
 attributes #0 = { "target-cpu"="pentium4" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" }
 


        


More information about the llvm-commits mailing list