brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · fad8fcd Raw
50 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -polly-invariant-load-hoisting=true -disable-output < %s 2>&1 | FileCheck %s2;3;4; CHECK:       Invariant Accesses: {5; CHECK-NEXT:    ReadAccess := [Reduction Type: NONE] [Scalar: 0]6; CHECK-NEXT:    [c] -> { Stmt_for_body[i0] -> MemRef_I[-1 + c] };7; CHECK-NEXT:    Execution Context: [c] -> {  : c > 0 }8; CHECK-NEXT:  }9; CHECK-NEXT:  Context:10; CHECK-NEXT:  [c] -> {  : -128 <= c <= 127 }11; CHECK-NEXT:  Assumed Context:12; CHECK-NEXT:  [c] -> {  :  }13; CHECK-NEXT:  Invalid Context:14; CHECK-NEXT:  [c] -> {  : c <= 0 }15;16;    void f(int *A, int *I, unsigned char c) {17;      for (int i = 0; i < 10; i++)18;        A[i] += I[c - (char)1];19;    }20;21target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"22 23define void @f(ptr %A, ptr %I, i8 zeroext %c) {24entry:25  br label %for.cond26 27for.cond:                                         ; preds = %for.inc, %entry28  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]29  %exitcond = icmp ne i64 %indvars.iv, 1030  br i1 %exitcond, label %for.body, label %for.end31 32for.body:                                         ; preds = %for.cond33  %sub = add i8 %c, -134  %conv = zext i8 %sub to i6435  %arrayidx = getelementptr inbounds i32, ptr %I, i64 %conv36  %tmp = load i32, ptr %arrayidx, align 437  %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv38  %tmp1 = load i32, ptr %arrayidx2, align 439  %add = add nsw i32 %tmp1, %tmp40  store i32 %add, ptr %arrayidx2, align 441  br label %for.inc42 43for.inc:                                          ; preds = %for.body44  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 145  br label %for.cond46 47for.end:                                          ; preds = %for.cond48  ret void49}50