60 lines · plain
1; RUN: opt %loadNPMPolly -S '-passes=polly<no-default-opts>' -polly-invariant-load-hoisting=false < %s | FileCheck %s2; RUN: opt %loadNPMPolly -S '-passes=polly<no-default-opts>' -polly-invariant-load-hoisting=true < %s | FileCheck %s3;4; Check that we generate valid code even if the load of cont_STACKPOINTER is5; hoisted in one SCoP and used (through the phi node %tmp2).6;7; CHECK: polly.start8; CHECK: polly.start9;10target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"11 12%struct1 = type { i32, %union1, ptr, i32, i32 }13%union1 = type { ptr }14%struct.2 = type { ptr, ptr }15 16@cont_STACKPOINTER = external global i32, align 417@cont_STACK = external global [1000 x i32], align 1618 19define fastcc void @subs_InternIdcEq() {20entry:21 br label %if.else.i.i22 23if.else.i.i: ; preds = %entry24 %tmp = load ptr, ptr undef, align 825 br label %while.body.i99.i.i26 27while.body.i99.i.i: ; preds = %while.body.i99.i.i, %if.else.i.i28 br i1 false, label %while.body.i99.i.i, label %while.end.i103.i.i29 30while.end.i103.i.i: ; preds = %while.body.i99.i.i31 %tmp1 = load i32, ptr @cont_STACKPOINTER, align 432 %dec.i.i102.i.i = add nsw i32 %tmp1, -133 br i1 false, label %cont_BackTrack.exit107.i.i, label %if.then.i106.i.i34 35if.then.i106.i.i: ; preds = %while.end.i103.i.i36 br label %cont_BackTrack.exit107.i.i37 38cont_BackTrack.exit107.i.i: ; preds = %if.then.i106.i.i, %while.end.i103.i.i39 %tmp2 = phi i32 [ %dec.i.i102.i.i, %if.then.i106.i.i ], [ 0, %while.end.i103.i.i ]40 br i1 undef, label %land.lhs.true23.i.i, label %for.inc.i.i41 42land.lhs.true23.i.i: ; preds = %cont_BackTrack.exit107.i.i43 %idxprom.i.i57.i.i = sext i32 %tmp2 to i6444 %arrayidx.i.i58.i.i = getelementptr inbounds [1000 x i32], ptr @cont_STACK, i64 0, i64 %idxprom.i.i57.i.i45 store i32 undef, ptr %arrayidx.i.i58.i.i, align 446 br i1 false, label %if.then.i45.i.i, label %fol_Atom.exit47.i.i47 48if.then.i45.i.i: ; preds = %land.lhs.true23.i.i49 br label %fol_Atom.exit47.i.i50 51fol_Atom.exit47.i.i: ; preds = %if.then.i45.i.i, %land.lhs.true23.i.i52 unreachable53 54for.inc.i.i: ; preds = %cont_BackTrack.exit107.i.i55 br label %for.end.i.i56 57for.end.i.i: ; preds = %for.inc.i.i58 ret void59}60