71 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb -S '-passes=polly-custom<scops>' -polly-print-scops -disable-output -polly-invariant-load-hoisting=true < %s 2>&1 | FileCheck %s2 3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"4 5%struct.IP = type { ptr, ptr, %struct.P, %struct.S, %struct.m }6%struct.P = type { i32 }7%struct.S = type { i32 }8%struct.D = type { i32 }9%struct.B = type { i32 }10%struct.E = type { i32 }11%struct.s = type { i32 }12%struct.M = type { i32 }13%struct.C = type { i32 }14%struct.T = type { i32 }15%struct.R = type { i32 }16%struct.m = type { i32 }17%struct.d = type { i32 }18 19 20; Verify that we do not invariant load hoist very complex conditions.21 22; CHECK: Statements {23; CHECK-NEXT: Stmt_entry_split24; CHECK-NEXT: Domain :=25; CHECK-NEXT: [block_y, block_x] -> { Stmt_entry_split[] };26; CHECK-NEXT: Schedule :=27; CHECK-NEXT: [block_y, block_x] -> { Stmt_entry_split[] -> [] };28; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]29; CHECK-NEXT: [block_y, block_x] -> { Stmt_entry_split[] -> MemRef4[o0] : (-3 <= block_y < 0 and block_x <= -4 and -8 + block_x - 4o0 <= 8*floor((-1 + block_x)/8) <= -5 + block_x - 4o0) or (-3 <= block_y < 0 and block_x >= 0 and -3 + block_x - 4o0 <= 8*floor((block_x)/8) <= block_x - 4o0) or (block_y <= -4 and block_x <= -4 and -16 + block_x - 4o0 - 8*floor((-1 + block_x)/8) + 8*floor((-1 + block_y)/4) <= 16*floor((-1 + block_y)/8) <= -13 + block_x - 4o0 - 8*floor((-1 + block_x)/8) + 8*floor((-1 + block_y)/4)) or (block_y <= -4 and block_x >= 0 and -11 + block_x - 4o0 - 8*floor((block_x)/8) + 8*floor((-1 + block_y)/4) <= 16*floor((-1 + block_y)/8) <= -8 + block_x - 4o0 - 8*floor((block_x)/8) + 8*floor((-1 + block_y)/4)) or (block_y >= 0 and block_x <= -4 and -8 + block_x - 4o0 - 8*floor((-1 + block_x)/8) + 8*floor((block_y)/4) <= 16*floor((block_y)/8) <= -5 + block_x - 4o0 - 8*floor((-1 + block_x)/8) + 8*floor((block_y)/4)) or (block_y >= 0 and block_x >= 0 and -3 + block_x - 4o0 - 8*floor((block_x)/8) + 8*floor((block_y)/4) <= 16*floor((block_y)/8) <= block_x - 4o0 - 8*floor((block_x)/8) + 8*floor((block_y)/4)) or (4*floor((block_y)/8) = -o0 + 2*floor((block_y)/4) and block_y >= 0 and -3 <= block_x < 0 and 4*floor((block_y)/4) >= -7 + block_y + 2o0 and 4*floor((block_y)/4) <= block_y + 2o0) or (4*floor((-1 + block_y)/8) = -2 - o0 + 2*floor((-1 + block_y)/4) and block_y <= -4 and -3 <= block_x < 0 and 4*floor((-1 + block_y)/4) >= -4 + block_y + 2o0 and 4*floor((-1 + block_y)/4) <= 3 + block_y + 2o0); Stmt_entry_split[] -> MemRef4[0] : -3 <= block_y < 0 and -3 <= block_x < 0 };30; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]31; CHECK-NEXT: [block_y, block_x] -> { Stmt_entry_split[] -> MemRef0[] };32; CHECK-NEXT: }33 34@img = external global ptr, align 835 36; Function Attrs: nounwind uwtable37define void @dct_luma(i32 %block_x, i32 %block_y) #0 {38entry:39 br label %entry.split40 41entry.split: ; preds = %entry42 %div = sdiv i32 %block_x, 443 %div1 = sdiv i32 %block_y, 444 %rem = srem i32 %div1, 245 %mul4 = shl nsw i32 %rem, 146 %rem5 = srem i32 %div, 247 %add6 = add nsw i32 %mul4, %rem548 %idxprom = sext i32 %add6 to i6449 %0 = load ptr, ptr @img, align 850 %1 = load ptr, ptr %0, align 851 %2 = load ptr, ptr %1, align 852 %arrayidx8 = getelementptr inbounds ptr, ptr %2, i64 %idxprom53 %3 = load ptr, ptr %arrayidx8, align 854 %mb_data = getelementptr inbounds %struct.IP, ptr %0, i64 0, i32 455 %4 = load %struct.m, ptr %mb_data, align 856 br i1 false, label %land.rhs, label %land.end57 58land.rhs: ; preds = %entry.split59 br label %land.end60 61land.end: ; preds = %land.rhs, %entry.split62 %5 = phi i1 [ false, %entry.split ], [ undef, %land.rhs ]63 br i1 %5, label %for.cond104.preheader, label %for.cond34.preheader64 65for.cond34.preheader: ; preds = %land.end66 ret void67 68for.cond104.preheader: ; preds = %land.end69 ret void70}71