brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 0248004 Raw
74 lines · plain
1; RUN: opt %loadNPMPolly -polly-allow-nonaffine '-passes=polly-custom<scops>' -polly-print-scops -S < %s 2>&1 | FileCheck %s --check-prefix=CODE2; RUN: opt %loadNPMPolly -polly-allow-nonaffine '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s3;4; Verify there is a phi in the non-affine region but it is not represented in5; the SCoP as all operands as well as the uses are inside the region too.6;7;    void f(int *A) {8;      for (int i = 0; i < 1024; i++) {9;        if (A[i]) {10;          int x = 0;11;          if (i > 512)12;            x = 1 + A[i];13;          A[i] = x;14;        }15;      }16;    }17;18; CODE-LABEL: bb11:19; CODE:         %x.0 = phi i3220;21; We have 3 accesses to A that should be present in the SCoP but no scalar access.22;23; CHECK-NOT: [Scalar: 1]24; CHECK:     [Scalar: 0]25; CHECK-NOT: [Scalar: 1]26; CHECK:     [Scalar: 0]27; CHECK-NOT: [Scalar: 1]28; CHECK:     [Scalar: 0]29; CHECK-NOT: [Scalar: 1]30;31target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"32 33define void @f(ptr %A) {34bb:35  br label %bb136 37bb1:                                              ; preds = %bb14, %bb38  %indvars.iv = phi i64 [ %indvars.iv.next, %bb14 ], [ 0, %bb ]39  %exitcond = icmp ne i64 %indvars.iv, 102440  br i1 %exitcond, label %bb2, label %bb1541 42bb2:                                              ; preds = %bb143  %tmp = getelementptr inbounds i32, ptr %A, i64 %indvars.iv44  %tmp3 = load i32,  ptr %tmp, align 445  %tmp4 = icmp eq i32 %tmp3, 046  br i1 %tmp4, label %bb13, label %bb547 48bb5:                                              ; preds = %bb249  %tmp6 = icmp sgt i64 %indvars.iv, 51250  br i1 %tmp6, label %bb7, label %bb1151 52bb7:                                              ; preds = %bb553  %tmp8 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv54  %tmp9 = load i32,  ptr %tmp8, align 455  %tmp10 = add nsw i32 %tmp9, 156  br label %bb1157 58bb11:                                             ; preds = %bb7, %bb559  %x.0 = phi i32 [ %tmp10, %bb7 ], [ 0, %bb5 ]60  %tmp12 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv61  store i32 %x.0, ptr %tmp12, align 462  br label %bb1363 64bb13:                                             ; preds = %bb2, %bb1165  br label %bb1466 67bb14:                                             ; preds = %bb1368  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 169  br label %bb170 71bb15:                                             ; preds = %bb172  ret void73}74