88 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly<no-default-opts>' -S -polly-invariant-load-hoisting=true < %s | FileCheck %s2 3; bugpoint-reduced testcase of MiBench/consumer-lame/quantize-pvt.c from the4; test-suite.5; It features a SCEV that is used in two BasicBlock within a non-affine6; subregion where none of the blocks dominate the other. We check that the SCEV7; is expanded independently for both BasicBlocks instead of just once for the8; whole subregion.9 10; CHECK-LABEL: polly.stmt.if.then.110:11; CHECK: %[[R1_1:[0-9]*]] = mul nuw nsw i64 %polly.indvar[[R0_1:[0-9]*]], 12012; CHECK: %scevgep[[R1_2:[0-9]*]] = getelementptr i8, ptr %scevgep{{[0-9]*}}, i64 %[[R1_1]]13; CHECK: store i32 0, ptr %scevgep[[R1_2]], align 814 15; CHECK-LABEL: polly.stmt.if.else:16; CHECK: %[[R2_1:[0-9]*]] = mul nuw nsw i64 %polly.indvar[[R0_1]], 12017; CHECK: %scevgep[[R2_2:[0-9]*]] = getelementptr i8, ptr %scevgep{{[0-9]*}}, i64 %[[R2_1]]18; CHECK: store i32 21, ptr %scevgep[[R2_2]], align 819 20target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"21target triple = "x86_64-unknown-linux-gnu"22 23%struct.gr_info.4.59.136.224.290 = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, [4 x i32] }24%struct.gr_info_ss.5.60.137.225.291 = type { %struct.gr_info.4.59.136.224.290 }25%struct.anon.6.61.138.226.292 = type { [2 x %struct.gr_info_ss.5.60.137.225.291] }26%struct.III_side_info_t.7.62.139.227.293 = type { i32, i32, i32, [2 x [4 x i32]], [2 x %struct.anon.6.61.138.226.292] }27%struct.lame_global_flags.3.58.135.223.289 = type { i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, float, i32, i32, i32, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }28 29@convert_mdct = external global i32, align 430@reduce_sidechannel = external global i32, align 431 32; Function Attrs: nounwind uwtable33define void @iteration_init(ptr %gfp, ptr %l3_side, ptr %l3_enc) {34entry:35 %resvDrain = getelementptr inbounds %struct.III_side_info_t.7.62.139.227.293, ptr %l3_side, i64 0, i32 236 store i32 0, ptr %resvDrain, align 837 store i32 0, ptr @convert_mdct, align 438 store i32 0, ptr @reduce_sidechannel, align 439 %mode_gr = getelementptr inbounds %struct.lame_global_flags.3.58.135.223.289, ptr %gfp, i64 0, i32 4540 %0 = load i32, ptr %mode_gr, align 841 %cmp95.145 = icmp sgt i32 %0, 042 br i1 %cmp95.145, label %for.cond.98.preheader, label %for.cond.120.preheader43 44for.cond.98.preheader: ; preds = %for.inc.117, %entry45 %indvars.iv157 = phi i64 [ %indvars.iv.next158, %for.inc.117 ], [ 0, %entry ]46 %stereo = getelementptr inbounds %struct.lame_global_flags.3.58.135.223.289, ptr %gfp, i64 0, i32 4647 %1 = load i32, ptr %stereo, align 448 %cmp99.143 = icmp sgt i32 %1, 049 br i1 %cmp99.143, label %for.body.101, label %for.inc.11750 51for.cond.120.preheader: ; preds = %for.inc.117, %entry52 ret void53 54for.body.101: ; preds = %for.inc.114, %for.cond.98.preheader55 %indvars.iv155 = phi i64 [ %indvars.iv.next156, %for.inc.114 ], [ 0, %for.cond.98.preheader ]56 %block_type = getelementptr inbounds %struct.III_side_info_t.7.62.139.227.293, ptr %l3_side, i64 0, i32 4, i64 %indvars.iv157, i32 0, i64 %indvars.iv155, i32 0, i32 657 %2 = load i32, ptr %block_type, align 858 %cmp108 = icmp eq i32 %2, 259 %sfb_lmax = getelementptr inbounds %struct.III_side_info_t.7.62.139.227.293, ptr %l3_side, i64 0, i32 4, i64 %indvars.iv157, i32 0, i64 %indvars.iv155, i32 0, i32 1660 br i1 %cmp108, label %if.then.110, label %if.else61 62if.then.110: ; preds = %for.body.10163 store i32 0, ptr %sfb_lmax, align 864 %sfb_smax = getelementptr inbounds %struct.III_side_info_t.7.62.139.227.293, ptr %l3_side, i64 0, i32 4, i64 %indvars.iv157, i32 0, i64 %indvars.iv155, i32 0, i32 1765 store i32 0, ptr %sfb_smax, align 466 br label %for.inc.11467 68if.else: ; preds = %for.body.10169 store i32 21, ptr %sfb_lmax, align 870 %sfb_smax112 = getelementptr inbounds %struct.III_side_info_t.7.62.139.227.293, ptr %l3_side, i64 0, i32 4, i64 %indvars.iv157, i32 0, i64 %indvars.iv155, i32 0, i32 1771 store i32 12, ptr %sfb_smax112, align 472 br label %for.inc.11473 74for.inc.114: ; preds = %if.else, %if.then.11075 %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 176 %3 = load i32, ptr %stereo, align 477 %4 = sext i32 %3 to i6478 %cmp99 = icmp slt i64 %indvars.iv.next156, %479 br i1 %cmp99, label %for.body.101, label %for.inc.11780 81for.inc.117: ; preds = %for.inc.114, %for.cond.98.preheader82 %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 183 %5 = load i32, ptr %mode_gr, align 884 %6 = sext i32 %5 to i6485 %cmp95 = icmp slt i64 %indvars.iv.next158, %686 br i1 %cmp95, label %for.cond.98.preheader, label %for.cond.120.preheader87}88