brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 5fc9dc3 Raw
63 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 52; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \3; RUN: | FileCheck %s4 5; XFAIL: *6; Currently fails since delinearization doesn't work as expected, due to the7; inconsistency in the estimated array sizes between `rr[i][j]` and `rr[j][j]`.8; The latter is now regarded as an access to a 1D array.9 10; Test for a bug, which caused an assert when an invalid11; SCEVAddRecExpr is created in addToCoefficient.12 13; float foo (float g, ptr rr[40]) {14;   float res= 0.0f;15;   for (int i = 0; i < 40; i += 5) {16;     for (int j = 0; j < 40; j += 5) {17;       float add = rr[j][j] + rr[i][j];18;       res = add > g? add : res;19;     }20;   }21;   return res;22; }23 24define float @foo(float %g, ptr %rr) nounwind {25; CHECK-LABEL: 'foo'26; CHECK-NEXT:  Src: %0 = load float, ptr %arrayidx4, align 4 --> Dst: %0 = load float, ptr %arrayidx4, align 427; CHECK-NEXT:    da analyze - consistent input [S 0]!28; CHECK-NEXT:  Src: %0 = load float, ptr %arrayidx4, align 4 --> Dst: %1 = load float, ptr %arrayidx6, align 429; CHECK-NEXT:    da analyze - input [* 0|<]!30; CHECK-NEXT:  Src: %1 = load float, ptr %arrayidx6, align 4 --> Dst: %1 = load float, ptr %arrayidx6, align 431; CHECK-NEXT:    da analyze - none!32;33entry:34  br label %for.cond1.preheader35 36for.cond1.preheader:37  %i.04 = phi i32 [ 0, %entry ], [ %add10, %for.inc9 ]38  %res.03 = phi float [ 0.000000e+00, %entry ], [ %add.res.1, %for.inc9 ]39  br label %for.body340 41for.body3:42  %j.02 = phi i32 [ 0, %for.cond1.preheader ], [ %add8, %for.body3 ]43  %res.11 = phi float [ %res.03, %for.cond1.preheader ], [ %add.res.1, %for.body3 ]44  %arrayidx4 = getelementptr inbounds [40 x float], ptr %rr, i32 %j.02, i32 %j.0245  %0 = load float, ptr %arrayidx4, align 446  %arrayidx6 = getelementptr inbounds [40 x float], ptr %rr, i32 %i.04, i32 %j.0247  %1 = load float, ptr %arrayidx6, align 448  %add = fadd float %0, %149  %cmp7 = fcmp ogt float %add, %g50  %add.res.1 = select i1 %cmp7, float %add, float %res.1151  %add8 = add nsw i32 %j.02, 552  %cmp2 = icmp slt i32 %add8, 4053  br i1 %cmp2, label %for.body3, label %for.inc954 55for.inc9:56  %add10 = add nsw i32 %i.04, 557  %cmp = icmp slt i32 %add10, 4058  br i1 %cmp, label %for.cond1.preheader, label %for.end1159 60for.end11:61  ret float %add.res.162}63