aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-03-04 18:25:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-03-04 18:25:41 +0000
commit1d6bb9f4171028bd0eb3dfcb59f42b28c279d4be (patch)
treebd5f9425e10e6616a37eac0815b3566ba1132430 /test/CodeGen/X86
parentbd7f07563c83e00dae23ea41c0fc4f95995e50cb (diff)
downloadsrc-1d6bb9f4171028bd0eb3dfcb59f42b28c279d4be.tar.gz
src-1d6bb9f4171028bd0eb3dfcb59f42b28c279d4be.zip
Vendor import of llvm release_80 branch r355313:vendor/llvm/llvm-release_80-r355313
Notes
Notes: svn path=/vendor/llvm/dist-release_80/; revision=344765 svn path=/vendor/llvm/llvm-release_80-r355313/; revision=344766; tag=vendor/llvm/llvm-release_80-r355313
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r--test/CodeGen/X86/code-model-elf.ll66
-rw-r--r--test/CodeGen/X86/pr40891.ll22
2 files changed, 88 insertions, 0 deletions
diff --git a/test/CodeGen/X86/code-model-elf.ll b/test/CodeGen/X86/code-model-elf.ll
index 56d3f4c102f0..f7ffd6ea1eb7 100644
--- a/test/CodeGen/X86/code-model-elf.ll
+++ b/test/CodeGen/X86/code-model-elf.ll
@@ -37,6 +37,8 @@ target triple = "x86_64--linux"
@global_data = dso_local global [10 x i32] [i32 1, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], align 16
@static_data = internal global [10 x i32] zeroinitializer, align 16
@extern_data = external global [10 x i32], align 16
+@thread_data = external thread_local global i32, align 4
+
define dso_local i32* @lea_static_data() #0 {
; SMALL-STATIC-LABEL: lea_static_data:
@@ -373,6 +375,70 @@ define dso_local void ()* @lea_extern_fn() #0 {
ret void ()* @extern_fn
}
+; FIXME: The result is same for small, medium and large model, because we
+; specify pie option in the test case. And the type of tls is initial exec tls.
+; For pic code. The large model code for pic tls should be emitted as below.
+
+; .L3:
+; leaq .L3(%rip), %rbx
+; movabsq $_GLOBAL_OFFSET_TABLE_-.L3, %r11
+; addq %r11, %rbx
+; leaq thread_data@TLSGD(%rip), %rdi
+; movabsq $__tls_get_addr@PLTOFF, %rax
+; addq %rbx, %rax
+; call *%rax
+; movl (%rax), %eax
+
+; The medium and small model code for pic tls should be emitted as below.
+; data16
+; leaq thread_data@TLSGD(%rip), %rdi
+; data16
+; data16
+; rex64
+; callq __tls_get_addr@PLT
+; movl (%rax), %eax
+
+define dso_local i32 @load_thread_data() #0 {
+; SMALL-STATIC-LABEL: load_thread_data:
+; SMALL-STATIC: # %bb.0:
+; SMALL-STATIC-NEXT: movq thread_data@GOTTPOFF(%rip), %rax
+; SMALL-STATIC-NEXT: movl %fs:(%rax), %eax
+; SMALL-STATIC-NEXT: retq
+;
+; MEDIUM-STATIC-LABEL: load_thread_data:
+; MEDIUM-STATIC: # %bb.0:
+; MEDIUM-STATIC-NEXT: movq thread_data@GOTTPOFF(%rip), %rax
+; MEDIUM-STATIC-NEXT: movl %fs:(%rax), %eax
+; MEDIUM-STATIC-NEXT: retq
+;
+; LARGE-STATIC-LABEL: load_thread_data:
+; LARGE-STATIC: # %bb.0:
+; LARGE-STATIC-NEXT: movq thread_data@GOTTPOFF(%rip), %rax
+; LARGE-STATIC-NEXT: movl %fs:(%rax), %eax
+; LARGE-STATIC-NEXT: retq
+;
+; SMALL-PIC-LABEL: load_thread_data:
+; SMALL-PIC: # %bb.0:
+; SMALL-PIC-NEXT: movq thread_data@GOTTPOFF(%rip), %rax
+; SMALL-PIC-NEXT: movl %fs:(%rax), %eax
+; SMALL-PIC-NEXT: retq
+;
+; MEDIUM-PIC-LABEL: load_thread_data:
+; MEDIUM-PIC: # %bb.0:
+; MEDIUM-PIC-NEXT: movq thread_data@GOTTPOFF(%rip), %rax
+; MEDIUM-PIC-NEXT: movl %fs:(%rax), %eax
+; MEDIUM-PIC-NEXT: retq
+;
+; LARGE-PIC-LABEL: load_thread_data:
+; LARGE-PIC: # %bb.0:
+; LARGE-PIC-NEXT: movq thread_data@GOTTPOFF(%rip), %rax
+; LARGE-PIC-NEXT: movl %fs:(%rax), %eax
+; LARGE-PIC-NEXT: retq
+;
+ %1 = load i32, i32* @thread_data, align 4
+ ret i32 %1
+}
+
attributes #0 = { noinline nounwind uwtable }
!llvm.module.flags = !{!0, !1, !2}
diff --git a/test/CodeGen/X86/pr40891.ll b/test/CodeGen/X86/pr40891.ll
new file mode 100644
index 000000000000..3f3cfb23d03d
--- /dev/null
+++ b/test/CodeGen/X86/pr40891.ll
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=avx2 | FileCheck %s
+
+; Make sure this sequence doesn't hang in DAG combine.
+
+define <8 x i32> @foo(<8 x i64> %x, <4 x i64> %y) {
+; CHECK-LABEL: foo:
+; CHECK: # %bb.0:
+; CHECK-NEXT: vandps %ymm2, %ymm0, %ymm0
+; CHECK-NEXT: vandps {{\.LCPI.*}}, %ymm1, %ymm1
+; CHECK-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,2,3,4,6,6,7]
+; CHECK-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,2,3]
+; CHECK-NEXT: vpermilps {{.*#+}} ymm1 = ymm1[0,2,2,3,4,6,6,7]
+; CHECK-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,2,3]
+; CHECK-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
+; CHECK-NEXT: retl
+ %a = shufflevector <4 x i64> %y, <4 x i64> <i64 12345, i64 67890, i64 13579, i64 24680>, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+ %b = and <8 x i64> %x, %a
+ %c = trunc <8 x i64> %b to <8 x i32>
+ ret <8 x i32> %c
+}
+