brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 3029c85 Raw
54 lines · plain
1; RUN: llc  -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \2; RUN:      -mtriple powerpc64-ibm-aix-xcoff -mattr=+aix-small-local-exec-tls < %s \3; RUN:      | FileCheck %s --check-prefixes=COMMONCM,SMALL-LOCAL-EXEC-SMALLCM644; RUN: llc  -verify-machineinstrs -mcpu=pwr7 -ppc-asm-full-reg-names \5; RUN:      -mtriple powerpc64-ibm-aix-xcoff --code-model=large \6; RUN:      -mattr=+aix-small-local-exec-tls < %s | FileCheck %s \7; RUN:      --check-prefixes=COMMONCM,SMALL-LOCAL-EXEC-LARGECM648 9@mySmallTLS = thread_local(localexec) global [7800 x i64] zeroinitializer, align 8 #010@mySmallTLS2 = thread_local(localexec) global [3000 x i64] zeroinitializer, align 8 #011@mySmallTLS3 = thread_local(localexec) global [3000 x i64] zeroinitializer, align 812declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull)13 14; Although some global variables are annotated with 'aix-small-tls', because the15; aix-small-local-exec-tls target attribute is turned on, all accesses will use16; a "faster" local-exec sequence directly off the thread pointer.17define i64 @StoreLargeAccess1() {18; COMMONCM-LABEL:    StoreLargeAccess1:19; COMMONCM-NEXT:     # %bb.0: # %entry20; SMALL-LOCAL-EXEC-SMALLCM64:         ld r3, L..C0(r2) # target-flags(ppc-tprel) @mySmallTLS21; SMALL-LOCAL-EXEC-SMALLCM64-NEXT:    li r4, 022; SMALL-LOCAL-EXEC-SMALLCM64-NEXT:    li r5, 2323; SMALL-LOCAL-EXEC-LARGECM64:         addis r3, L..C0@u(r2)24; SMALL-LOCAL-EXEC-LARGECM64-NEXT:    li r4, 025; SMALL-LOCAL-EXEC-LARGECM64-NEXT:    li r5, 2326; SMALL-LOCAL-EXEC-LARGECM64-NEXT:    ld r3, L..C0@l(r3)27; COMMONCM:                           ori r4, r4, 5332828; COMMONCM-NEXT:                      add r3, r13, r329; COMMONCM-NEXT:                      stdx r5, r3, r430; COMMONCM-NEXT:                      li r3, 5531; COMMONCM-NEXT:                      li r4, 6432; COMMONCM-NEXT:                      std r3, mySmallTLS2[TL]@le+696-65536(r13)33; COMMONCM-NEXT:                      li r3, 14234; COMMONCM-NEXT:                      std r4, mySmallTLS3[TL]@le+20000-131072(r13)35; COMMONCM-NEXT:                      blr36entry:37  %tls0 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mySmallTLS)38  %arrayidx = getelementptr inbounds i8, ptr %tls0, i32 5332839  store i64 23, ptr %arrayidx, align 840  %tls1 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mySmallTLS2)41  %arrayidx1 = getelementptr inbounds i8, ptr %tls1, i32 69642  store i64 55, ptr %arrayidx1, align 843  %tls2 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mySmallTLS3)44  %arrayidx2 = getelementptr inbounds i8, ptr %tls2, i32 2000045  store i64 64, ptr %arrayidx2, align 846  %load1 = load i64, ptr %arrayidx, align 847  %load2 = load i64, ptr %arrayidx1, align 848  %add1 = add i64 %load1, 6449  %add2 = add i64 %add1, %load250  ret i64 %add251}52 53attributes #0 = { "aix-small-tls" }54