1 ; RUN: opt %loadPolly -S -polly-codegen -polly-invariant-load-hoisting=true < %s
3 ; Check that we generate valid code as we did non preload the base pointer
4 ; origin of %tmp4 at some point.
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8 @TOP = external global ptr, align 8
9 @BOT = external global ptr, align 8
11 define void @RemoveConstraintVCG() {
13 br i1 undef, label %for.end.161, label %for.cond.2.preheader
15 for.cond.2.preheader: ; preds = %entry
16 br i1 undef, label %for.end.128, label %for.body.4
18 for.body.4: ; preds = %for.inc.126, %for.cond.2.preheader
19 br i1 undef, label %for.cond.8.preheader, label %for.inc.126
21 for.cond.8.preheader: ; preds = %for.body.4
22 br i1 undef, label %for.inc.126, label %for.body.11
24 for.body.11: ; preds = %for.inc, %for.cond.8.preheader
25 br i1 undef, label %land.lhs.true, label %for.inc
27 land.lhs.true: ; preds = %for.body.11
28 br i1 undef, label %if.then.20, label %for.inc
30 if.then.20: ; preds = %land.lhs.true
31 %tmp = load ptr, ptr @TOP, align 8
32 %tmp1 = load i64, ptr %tmp, align 8
33 %cmp25 = icmp eq i64 %tmp1, 1
34 %cmp47 = icmp eq i64 %tmp1, 0
35 br i1 false, label %if.end.117, label %lor.lhs.false.85
37 lor.lhs.false.85: ; preds = %if.then.20
38 %add94 = add i64 %tmp1, 1
39 %tmp2 = load ptr, ptr @TOP, align 8
40 %arrayidx95 = getelementptr inbounds i64, ptr %tmp2, i64 %add94
41 %tmp3 = load i64, ptr %arrayidx95, align 8
42 br i1 false, label %if.else.103, label %land.lhs.true.97
44 land.lhs.true.97: ; preds = %lor.lhs.false.85
45 %tmp4 = load ptr, ptr @BOT, align 8
46 %arrayidx99 = getelementptr inbounds i64, ptr %tmp4, i64 %add94
47 %tmp5 = load i64, ptr %arrayidx99, align 8
48 %tobool100 = icmp eq i64 %tmp5, 0
49 br i1 %tobool100, label %if.else.103, label %if.then.101
51 if.then.101: ; preds = %land.lhs.true.97
54 if.else.103: ; preds = %land.lhs.true.97, %lor.lhs.false.85
55 %tmp6 = load ptr, ptr @TOP, align 8
56 %arrayidx105 = getelementptr inbounds i64, ptr %tmp6, i64 %add94
57 %tmp7 = load i64, ptr %arrayidx105, align 8
58 br i1 false, label %lor.lhs.false.107, label %if.else.112
60 lor.lhs.false.107: ; preds = %if.else.103
61 %tmp8 = load ptr, ptr @BOT, align 8
62 %arrayidx109 = getelementptr inbounds i64, ptr %tmp8, i64 %add94
63 br i1 false, label %if.end.117, label %if.else.112
65 if.else.112: ; preds = %lor.lhs.false.107, %if.else.103
68 if.end.117: ; preds = %if.else.112, %lor.lhs.false.107, %if.then.101, %if.then.20
69 br i1 undef, label %if.then.119, label %for.inc
71 if.then.119: ; preds = %if.end.117
74 for.inc: ; preds = %if.then.119, %if.end.117, %land.lhs.true, %for.body.11
75 br i1 false, label %for.body.11, label %for.inc.126
77 for.inc.126: ; preds = %for.inc, %for.cond.8.preheader, %for.body.4
78 br i1 undef, label %for.end.128, label %for.body.4
80 for.end.128: ; preds = %for.inc.126, %for.cond.2.preheader
81 br i1 false, label %cond.false, label %cond.end
83 cond.false: ; preds = %for.end.128
86 cond.end: ; preds = %for.end.128
89 for.end.161: ; preds = %entry