51 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-linux-gnu | FileCheck %s --check-prefix=X643; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s --check-prefix=X324; RUN: llc < %s -mtriple=i386-linux-gnu | FileCheck %s --check-prefix=X865 6declare ptr @llvm.thread.pointer()7 8define ptr @thread_pointer() nounwind {9; X64-LABEL: thread_pointer:10; X64: # %bb.0:11; X64-NEXT: movq %fs:0, %rax12; X64-NEXT: retq13;14; X32-LABEL: thread_pointer:15; X32: # %bb.0:16; X32-NEXT: movl %fs:0, %eax17; X32-NEXT: retq18;19; X86-LABEL: thread_pointer:20; X86: # %bb.0:21; X86-NEXT: movl %gs:0, %eax22; X86-NEXT: retl23 %1 = tail call ptr @llvm.thread.pointer()24 ret ptr %125}26 27define i32 @thread_pointer2(i32 %i) nounwind {28; X64-LABEL: thread_pointer2:29; X64: # %bb.0: # %entry30; X64-NEXT: movslq %edi, %rax31; X64-NEXT: movl %fs:(,%rax,4), %eax32; X64-NEXT: retq33;34; X32-LABEL: thread_pointer2:35; X32: # %bb.0: # %entry36; X32-NEXT: movl %fs:0, %eax37; X32-NEXT: movl (%eax,%edi,4), %eax38; X32-NEXT: retq39;40; X86-LABEL: thread_pointer2:41; X86: # %bb.0: # %entry42; X86-NEXT: movl {{[0-9]+}}(%esp), %eax43; X86-NEXT: movl %gs:(,%eax,4), %eax44; X86-NEXT: retl45entry:46 %0 = tail call ptr @llvm.thread.pointer()47 %arrayidx = getelementptr inbounds i32, ptr %0, i32 %i48 %1 = load i32, ptr %arrayidx, align 449 ret i32 %150}51