[llvm] e8f4388 - [X86][test] Use separate check prefix in code-model-elf.ll
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 13 13:06:08 PST 2023
Author: Arthur Eubanks
Date: 2023-12-13T13:05:59-08:00
New Revision: e8f43883a073f4ef71e7f724143e068099649952
URL: https://github.com/llvm/llvm-project/commit/e8f43883a073f4ef71e7f724143e068099649952
DIFF: https://github.com/llvm/llvm-project/commit/e8f43883a073f4ef71e7f724143e068099649952.diff
LOG: [X86][test] Use separate check prefix in code-model-elf.ll
Since these will produce different results in upcoming changes.
Added:
Modified:
llvm/test/CodeGen/X86/code-model-elf.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/code-model-elf.ll b/llvm/test/CodeGen/X86/code-model-elf.ll
index 06989b0ffd22cd..0f58ccaf298dab 100644
--- a/llvm/test/CodeGen/X86/code-model-elf.ll
+++ b/llvm/test/CodeGen/X86/code-model-elf.ll
@@ -9,7 +9,7 @@
; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=medium -large-data-threshold=1000 | FileCheck %s --check-prefix=CHECK --check-prefix=MEDIUM-SMALL-DATA-PIC
; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=medium | FileCheck %s --check-prefix=CHECK --check-prefix=MEDIUM-PIC
; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=large | FileCheck %s --check-prefix=CHECK --check-prefix=LARGE-PIC
-; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=large -large-data-threshold=1000 | FileCheck %s --check-prefix=CHECK --check-prefix=LARGE-PIC
+; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=large -large-data-threshold=1000 | FileCheck %s --check-prefix=CHECK --check-prefix=LARGE-SMALL-DATA-PIC
; Generated from this C source:
;
@@ -89,6 +89,16 @@ define dso_local ptr @lea_static_data() #0 {
; LARGE-PIC-NEXT: movabsq $static_data at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_static_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L0$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L0$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L0$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $static_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @static_data
}
@@ -134,6 +144,16 @@ define dso_local ptr @lea_global_data() #0 {
; LARGE-PIC-NEXT: movabsq $global_data at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_global_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L1$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L1$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L1$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $global_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @global_data
}
@@ -177,6 +197,16 @@ define dso_local ptr @lea_extern_data() #0 {
; LARGE-PIC-NEXT: movabsq $extern_data at GOT, %rax
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_extern_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L2$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L2$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L2$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $extern_data at GOT, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movq (%rcx,%rax), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @extern_data
}
@@ -224,6 +254,16 @@ define dso_local ptr @lea_unknown_size_data() #0 {
; LARGE-PIC-NEXT: movabsq $unknown_size_data at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_unknown_size_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L3$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L3$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L3$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $unknown_size_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @unknown_size_data
}
@@ -268,6 +308,16 @@ define dso_local ptr @lea_forced_small_data() #0 {
; LARGE-PIC-NEXT: movabsq $forced_small_data at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_forced_small_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L4$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L4$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L4$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $forced_small_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @forced_small_data
}
@@ -316,6 +366,16 @@ define dso_local i32 @load_forced_small_data() #0 {
; LARGE-PIC-NEXT: movabsq $forced_small_data at GOTOFF, %rax
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: load_forced_small_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L5$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L5$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L5$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $forced_small_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rcx,%rax), %eax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
%rv = load i32, ptr getelementptr inbounds (i32, ptr @forced_small_data, i64 2)
ret i32 %rv
}
@@ -366,6 +426,16 @@ define dso_local ptr @lea_forced_large_data() #0 {
; LARGE-PIC-NEXT: movabsq $forced_large_data at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_forced_large_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L6$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L6$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L6$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $forced_large_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @forced_large_data
}
@@ -416,6 +486,16 @@ define dso_local i32 @load_forced_large_data() #0 {
; LARGE-PIC-NEXT: movabsq $forced_large_data at GOTOFF, %rax
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: load_forced_large_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L7$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L7$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L7$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $forced_large_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rcx,%rax), %eax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
%rv = load i32, ptr getelementptr inbounds (i32, ptr @forced_large_data, i64 2)
ret i32 %rv
}
@@ -465,6 +545,16 @@ define dso_local i32 @load_global_data() #0 {
; LARGE-PIC-NEXT: movabsq $global_data at GOTOFF, %rax
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: load_global_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L8$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L8$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L8$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $global_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rcx,%rax), %eax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
%rv = load i32, ptr getelementptr inbounds ([10 x i32], ptr @global_data, i64 0, i64 2)
ret i32 %rv
}
@@ -516,6 +606,17 @@ define dso_local i32 @load_extern_data() #0 {
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
; LARGE-PIC-NEXT: movl 8(%rax), %eax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: load_extern_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L9$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L9$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L9$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $extern_data at GOT, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movq (%rcx,%rax), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rax), %eax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
%rv = load i32, ptr getelementptr inbounds ([10 x i32], ptr @extern_data, i64 0, i64 2)
ret i32 %rv
}
@@ -566,6 +667,16 @@ define dso_local i32 @load_unknown_size_data() #0 {
; LARGE-PIC-NEXT: movabsq $unknown_size_data at GOTOFF, %rax
; LARGE-PIC-NEXT: movl 8(%rcx,%rax), %eax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: load_unknown_size_data:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L10$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L10$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L10$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $unknown_size_data at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movl 8(%rcx,%rax), %eax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
%rv = load i32, ptr getelementptr inbounds (i32, ptr @unknown_size_data, i64 2)
ret i32 %rv
}
@@ -614,6 +725,16 @@ define dso_local ptr @lea_opaque() #0 {
; LARGE-PIC-NEXT: movabsq $opaque at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_opaque:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L11$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L11$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L11$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $opaque at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @opaque
}
@@ -685,6 +806,16 @@ define dso_local ptr @lea_static_fn() #0 {
; LARGE-PIC-NEXT: movabsq $static_fn at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_static_fn:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L15$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L15$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L15$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $static_fn at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @static_fn
}
@@ -728,6 +859,16 @@ define dso_local ptr @lea_global_fn() #0 {
; LARGE-PIC-NEXT: movabsq $global_fn at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_global_fn:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L16$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L16$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L16$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $global_fn at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @global_fn
}
@@ -771,6 +912,16 @@ define dso_local ptr @lea_extern_fn() #0 {
; LARGE-PIC-NEXT: movabsq $extern_fn at GOT, %rax
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_extern_fn:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L17$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L17$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L17$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $extern_fn at GOT, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movq (%rcx,%rax), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @extern_fn
}
@@ -814,6 +965,16 @@ define dso_local ptr @lea_ifunc() #0 {
; LARGE-PIC-NEXT: movabsq $ifunc_func at GOT, %rax
; LARGE-PIC-NEXT: movq (%rcx,%rax), %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_ifunc:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L18$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L18$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L18$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $ifunc_func at GOT, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movq (%rcx,%rax), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @ifunc_func
}
@@ -857,6 +1018,16 @@ define dso_local ptr @lea_dso_local_ifunc() #0 {
; LARGE-PIC-NEXT: movabsq $dso_local_ifunc_func at GOTOFF, %rax
; LARGE-PIC-NEXT: addq %rcx, %rax
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: lea_dso_local_ifunc:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L19$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L19$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L19$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $dso_local_ifunc_func at GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rcx, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: retq
ret ptr @dso_local_ifunc_func
}
@@ -935,6 +1106,16 @@ define dso_local float @load_constant_pool(float %x) #0 {
; LARGE-PIC-NEXT: movabsq ${{\.?LCPI[0-9]+_[0-9]+}}@GOTOFF, %rax
; LARGE-PIC-NEXT: addss (%rcx,%rax), %xmm0
; LARGE-PIC-NEXT: retq
+;
+; LARGE-SMALL-DATA-PIC-LABEL: load_constant_pool:
+; LARGE-SMALL-DATA-PIC: # %bb.0:
+; LARGE-SMALL-DATA-PIC-NEXT: .L21$pb:
+; LARGE-SMALL-DATA-PIC-NEXT: leaq .L21$pb(%rip), %rax
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L21$pb, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: addq %rax, %rcx
+; LARGE-SMALL-DATA-PIC-NEXT: movabsq ${{\.?LCPI[0-9]+_[0-9]+}}@GOTOFF, %rax
+; LARGE-SMALL-DATA-PIC-NEXT: addss (%rcx,%rax), %xmm0
+; LARGE-SMALL-DATA-PIC-NEXT: retq
%a = fadd float %x, 1.0
ret float %a
}
More information about the llvm-commits
mailing list