summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2009-04-10 10:09:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2009-04-10 10:09:34 +0000
commitdbcfb3080a1e208aef8e4f13a94ce3aa8309643f (patch)
treee9158b75ba0a84dc6789a27a89cf8c051de5b8e9 /test/CodeGen
parentcb8c4778d3b86d47475a3ba3dea86dc0c887e5af (diff)
downloadllvm-dbcfb3080a1e208aef8e4f13a94ce3aa8309643f.tar.gz
llvm-dbcfb3080a1e208aef8e4f13a94ce3aa8309643f.tar.bz2
llvm-dbcfb3080a1e208aef8e4f13a94ce3aa8309643f.tar.xz
Don't fold a load if the other operand is a TLS address.
With this we generate movl %gs:0, %eax leal i@NTPOFF(%eax), %eax instead of movl $i@NTPOFF, %eax addl %gs:0, %eax git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/tls10.ll4
-rw-r--r--test/CodeGen/X86/tls15.ll14
-rw-r--r--test/CodeGen/X86/tls2.ll4
-rw-r--r--test/CodeGen/X86/tls6.ll4
-rw-r--r--test/CodeGen/X86/tls8.ll4
5 files changed, 22 insertions, 8 deletions
diff --git a/test/CodeGen/X86/tls10.ll b/test/CodeGen/X86/tls10.ll
index 5f022e3992..a4f2fb1293 100644
--- a/test/CodeGen/X86/tls10.ll
+++ b/test/CodeGen/X86/tls10.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
-; RUN: grep {movl \$i@NTPOFF, %eax} %t
-; RUN: grep {addl %gs:0, %eax} %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {leal i@NTPOFF(%eax), %eax} %t
@i = external hidden thread_local global i32
diff --git a/test/CodeGen/X86/tls15.ll b/test/CodeGen/X86/tls15.ll
new file mode 100644
index 0000000000..5d3ee16a47
--- /dev/null
+++ b/test/CodeGen/X86/tls15.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movl %gs:0, %eax} %t | count 1
+; RUN: grep {leal i@NTPOFF(%eax), %ecx} %t
+; RUN: grep {leal j@NTPOFF(%eax), %eax} %t
+
+@i = thread_local global i32 0
+@j = thread_local global i32 0
+
+define void @f(i32** %a, i32** %b) {
+entry:
+ store i32* @i, i32** %a, align 8
+ store i32* @j, i32** %b, align 8
+ ret void
+}
diff --git a/test/CodeGen/X86/tls2.ll b/test/CodeGen/X86/tls2.ll
index 8edc64ffba..fb57ae1a39 100644
--- a/test/CodeGen/X86/tls2.ll
+++ b/test/CodeGen/X86/tls2.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
-; RUN: grep {movl \$i@NTPOFF, %eax} %t
-; RUN: grep {addl %gs:0, %eax} %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {leal i@NTPOFF(%eax), %eax} %t
@i = thread_local global i32 15
diff --git a/test/CodeGen/X86/tls6.ll b/test/CodeGen/X86/tls6.ll
index fc10a57cc1..e0bcade8dd 100644
--- a/test/CodeGen/X86/tls6.ll
+++ b/test/CodeGen/X86/tls6.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
-; RUN: grep {movl \$i@NTPOFF, %eax} %t
-; RUN: grep {addl %gs:0, %eax} %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {leal i@NTPOFF(%eax), %eax} %t
@i = internal thread_local global i32 15
diff --git a/test/CodeGen/X86/tls8.ll b/test/CodeGen/X86/tls8.ll
index fb570b0118..4971fd23ba 100644
--- a/test/CodeGen/X86/tls8.ll
+++ b/test/CodeGen/X86/tls8.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
-; RUN: grep {movl \$i@NTPOFF, %eax} %t
-; RUN: grep {addl %gs:0, %eax} %t
+; RUN: grep {movl %gs:0, %eax} %t
+; RUN: grep {leal i@NTPOFF(%eax), %eax} %t
@i = hidden thread_local global i32 15