brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 20e1fa8 Raw
48 lines · plain
1; RUN: opt -mtriple=x86_64-unknown-linux-gnu -passes=load-store-vectorizer -S < %s | \2; RUN:     FileCheck %s3; RUN: opt -mtriple=x86_64-unknown-linux-gnu -aa-pipeline=basic-aa -passes='function(load-store-vectorizer)' -S < %s | \4; RUN:     FileCheck %s5;6; The GPU Load & Store Vectorizer may merge differently-typed accesses into a7; single instruction. This test checks that we merge TBAA tags for such8; accesses correctly.9 10target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"11 12; struct S {13;   float f;14;   int i;15; };16%struct.S = type { float, i32 }17 18; float foo(S *p) {19;   p->f -= 1;20;   p->i -= 1;21;   return p->f;22; }23define float @foo(ptr %p) {24entry:25; CHECK-LABEL: foo26; CHECK: load <2 x i32>, {{.*}}, !tbaa [[TAG_char:!.*]]27; CHECK: store <2 x i32> {{.*}}, !tbaa [[TAG_char]]28  %0 = load float, ptr %p, align 4, !tbaa !229  %sub = fadd float %0, -1.000000e+0030  store float %sub, ptr %p, align 4, !tbaa !231  %i = getelementptr inbounds %struct.S, ptr %p, i64 0, i32 132  %1 = load i32, ptr %i, align 4, !tbaa !833  %sub1 = add nsw i32 %1, -134  store i32 %sub1, ptr %i, align 4, !tbaa !835  ret float %sub36}37 38!2 = !{!3, !4, i64 0}39!3 = !{!"_ZTS1S", !4, i64 0, !7, i64 4}40!4 = !{!"float", !5, i64 0}41!5 = !{!"omnipotent char", !6, i64 0}42!6 = !{!"Simple C++ TBAA"}43!7 = !{!"int", !5, i64 0}44!8 = !{!3, !7, i64 4}45 46; CHECK-DAG: [[TYPE_char:!.*]] = !{!"omnipotent char", {{.*}}, i64 0}47; CHECK-DAG: [[TAG_char]] = !{[[TYPE_char]], [[TYPE_char]], i64 0}48