brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 19cc334 Raw
72 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<delicm>' -polly-print-delicm -disable-output < %s | FileCheck %s2 3; When %b is 0, %for.body13 is an infinite loop. In this case the loaded4; value %1 is not used anywhere.5; This is a problem when DeLICM tries to map %1 to %arrayidx16 because6; %1 has no corresponding when %b == 0 and therefore hat no location7; where it can be mapped to. However, since %b == 0 results in an8; infinite loop, it should not in the Context, or in this case, in the9; InvalidContext.10;11; Test case reduced from llvm.org/PR48445.12 13target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"14 15@arr_18 = external dso_local local_unnamed_addr global [0 x i16], align 216 17define void @func(i64 %b, ptr %c) {18entry:19  %conv1 = trunc i64 %b to i3220  %sext = shl i32 %conv1, 2421  %conv2 = ashr exact i32 %sext, 2422  %arrayidx = getelementptr inbounds i8, ptr %c, i64 %b23  %tobool19.not = icmp eq i64 %b, 024  br label %for.cond3.preheader25 26for.cond3.preheader:27  %d.039 = phi i16 [ 0, %entry ], [ %inc, %for.cond.cleanup6 ]28  %idxprom = sext i16 %d.039 to i6429  br label %for.cond8.preheader30 31for.cond8.preheader:32  br label %for.body1333 34for.cond.cleanup6:35  %arrayidx16 = getelementptr inbounds [0 x i16], ptr @arr_18, i64 0, i64 %idxprom36  %0 = zext i8 %1 to i1637  store i16 %0, ptr %arrayidx16, align 238  %inc = add i16 %d.039, 139  %conv = sext i16 %inc to i3240  %cmp = icmp sgt i32 %conv2, %conv41  br i1 %cmp, label %for.cond3.preheader, label %for.cond.cleanup42 43for.cond.cleanup12:44  br i1 false, label %for.cond8.preheader, label %for.cond.cleanup645 46for.body13:47  %1 = load i8, ptr %arrayidx, align 148  br i1 %tobool19.not, label %for.body13, label %for.cond.cleanup1249 50for.cond.cleanup:51  ret void52}53 54 55; CHECK: Statistics {56; CHECK:     Value scalars mapped:  157; CHECK: }58; CHECK:      After accesses {59; CHECK-NEXT:     Stmt_for_body1360; CHECK-NEXT:             ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]61; CHECK-NEXT:                 [b] -> { Stmt_for_body13[i0, i1, i2] -> MemRef_c[b] };62; CHECK-NEXT:             MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]63; CHECK-NEXT:                 [b] -> { Stmt_for_body13[i0, i1, i2] -> MemRef1[] };64; CHECK-NEXT:            new: [b] -> { Stmt_for_body13[i0, i1, i2] -> MemRef_arr_18[i0] : i0 < b; Stmt_for_body13[0, i1, i2] -> MemRef_arr_18[0] : b < 0 };65; CHECK-NEXT:     Stmt_for_cond_cleanup666; CHECK-NEXT:             ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]67; CHECK-NEXT:                 [b] -> { Stmt_for_cond_cleanup6[i0] -> MemRef1[] };68; CHECK-NEXT:            new: [b] -> { Stmt_for_cond_cleanup6[i0] -> MemRef_arr_18[i0] : i0 < b; Stmt_for_cond_cleanup6[0] -> MemRef_arr_18[0] : b < 0 };69; CHECK-NEXT:             MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]70; CHECK-NEXT:                 [b] -> { Stmt_for_cond_cleanup6[i0] -> MemRef_arr_18[i0] };71; CHECK-NEXT: }72