2013-03-28 07:16:18 +08:00
|
|
|
; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mcpu=penryn -mattr=sse41 | FileCheck %s --check-prefix=X32
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux -mcpu=penryn -mattr=sse41 | FileCheck %s --check-prefix=X64
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-win32 -mcpu=penryn -mattr=sse41 | FileCheck %s --check-prefix=X64
|
2009-01-26 09:24:32 +08:00
|
|
|
|
2010-09-21 11:37:00 +08:00
|
|
|
define i32 @test1() nounwind readonly {
|
2009-01-26 09:24:32 +08:00
|
|
|
entry:
|
|
|
|
%tmp = load i32* addrspace(256)* getelementptr (i32* addrspace(256)* inttoptr (i32 72 to i32* addrspace(256)*), i32 31) ; <i32*> [#uses=1]
|
|
|
|
%tmp1 = load i32* %tmp ; <i32> [#uses=1]
|
|
|
|
ret i32 %tmp1
|
|
|
|
}
|
2013-07-14 04:38:47 +08:00
|
|
|
; X32-LABEL: test1:
|
2010-09-21 11:37:00 +08:00
|
|
|
; X32: movl %gs:196, %eax
|
|
|
|
; X32: movl (%eax), %eax
|
|
|
|
; X32: ret
|
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; X64-LABEL: test1:
|
2010-09-21 11:37:00 +08:00
|
|
|
; X64: movq %gs:320, %rax
|
|
|
|
; X64: movl (%rax), %eax
|
|
|
|
; X64: ret
|
|
|
|
|
|
|
|
define i64 @test2(void (i8*)* addrspace(256)* %tmp8) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp9 = load void (i8*)* addrspace(256)* %tmp8, align 8
|
|
|
|
tail call void %tmp9(i8* undef) nounwind optsize
|
|
|
|
ret i64 0
|
|
|
|
}
|
|
|
|
|
|
|
|
; rdar://8453210
|
2013-07-14 04:38:47 +08:00
|
|
|
; X32-LABEL: test2:
|
2010-09-22 08:46:26 +08:00
|
|
|
; X32: movl {{.*}}(%esp), %eax
|
2010-09-22 13:49:14 +08:00
|
|
|
; X32: calll *%gs:(%eax)
|
2010-09-21 11:37:00 +08:00
|
|
|
|
2013-07-14 04:38:47 +08:00
|
|
|
; X64-LABEL: test2:
|
2011-02-22 15:21:01 +08:00
|
|
|
; X64: callq *%gs:([[A0:%rdi|%rcx]])
|
2010-09-22 08:34:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
define <2 x i64> @pmovsxwd_1(i64 addrspace(256)* %p) nounwind readonly {
|
|
|
|
entry:
|
|
|
|
%0 = load i64 addrspace(256)* %p
|
|
|
|
%tmp2 = insertelement <2 x i64> zeroinitializer, i64 %0, i32 0
|
|
|
|
%1 = bitcast <2 x i64> %tmp2 to <8 x i16>
|
|
|
|
%2 = tail call <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16> %1) nounwind readnone
|
|
|
|
%3 = bitcast <4 x i32> %2 to <2 x i64>
|
|
|
|
ret <2 x i64> %3
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-LABEL: pmovsxwd_1:
|
2010-09-22 08:34:38 +08:00
|
|
|
; X32: movl 4(%esp), %eax
|
|
|
|
; X32: pmovsxwd %gs:(%eax), %xmm0
|
|
|
|
; X32: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-LABEL: pmovsxwd_1:
|
2011-02-22 15:21:01 +08:00
|
|
|
; X64: pmovsxwd %gs:([[A0]]), %xmm0
|
2010-09-22 08:34:38 +08:00
|
|
|
; X64: ret
|
|
|
|
}
|
|
|
|
|
2012-07-31 04:23:19 +08:00
|
|
|
; The two loads here both look identical to selection DAG, except for their
|
|
|
|
; address spaces. Make sure they aren't CSE'd.
|
|
|
|
define i32 @test_no_cse() nounwind readonly {
|
|
|
|
entry:
|
|
|
|
%tmp = load i32* addrspace(256)* getelementptr (i32* addrspace(256)* inttoptr (i32 72 to i32* addrspace(256)*), i32 31) ; <i32*> [#uses=1]
|
|
|
|
%tmp1 = load i32* %tmp ; <i32> [#uses=1]
|
|
|
|
%tmp2 = load i32* addrspace(257)* getelementptr (i32* addrspace(257)* inttoptr (i32 72 to i32* addrspace(257)*), i32 31) ; <i32*> [#uses=1]
|
|
|
|
%tmp3 = load i32* %tmp2 ; <i32> [#uses=1]
|
|
|
|
%tmp4 = add i32 %tmp1, %tmp3
|
|
|
|
ret i32 %tmp4
|
|
|
|
}
|
2013-07-14 04:38:47 +08:00
|
|
|
; X32-LABEL: test_no_cse:
|
2012-07-31 04:23:19 +08:00
|
|
|
; X32: movl %gs:196
|
|
|
|
; X32: movl %fs:196
|
|
|
|
; X32: ret
|
|
|
|
|
2010-09-22 08:34:38 +08:00
|
|
|
declare <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16>) nounwind readnone
|