1 ; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s
3 ; This crashed at some point as the invariant load is in a non-affine
4 ; subregion. Just check it does not anymore.
8 ; ModuleID = 'bugpoint-reduced-simplified.bc'
9 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11 %struct.d = type { i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
13 @board = external global [421 x i8], align 16
14 @output_flags = external global i32, align 4
15 @dragon = external global [400 x %struct.d], align 16
17 ; Function Attrs: nounwind uwtable
18 define void @sgffile_add_debuginfo() #0 {
22 entry.split: ; preds = %entry
23 %0 = getelementptr inbounds [24 x i8], [24 x i8]* undef, i64 0, i64 0
24 br i1 false, label %cleanup, label %for.cond1.preheader
26 for.cond1.preheader: ; preds = %entry.split
27 br i1 false, label %if.then7, label %land.lhs.true49
29 if.then7: ; preds = %for.cond1.preheader
30 %arrayidx = getelementptr inbounds [421 x i8], [421 x i8]* @board, i64 0, i64 0
31 %crude_status = getelementptr inbounds [400 x %struct.d], [400 x %struct.d]* @dragon, i64 0, i64 0, i32 5
32 switch i32 0, label %if.end15 [
37 sw.bb: ; preds = %if.then7
40 sw.bb13: ; preds = %if.then7
43 if.end15: ; preds = %sw.bb13, %sw.bb, %if.then7
44 %cmp21 = fcmp ogt float undef, 0.000000e+00
45 br i1 %cmp21, label %land.lhs.true23, label %for.cond1.for.inc44_crit_edge
47 land.lhs.true23: ; preds = %if.end15
48 %1 = load i32, i32* @output_flags, align 4
49 %and24 = and i32 %1, 2
50 %tobool25 = icmp eq i32 %and24, 0
51 br i1 %tobool25, label %for.cond1.for.inc44_crit_edge, label %if.else
53 if.else: ; preds = %land.lhs.true23
54 br label %for.cond1.for.inc44_crit_edge
56 for.cond1.for.inc44_crit_edge: ; preds = %if.else, %land.lhs.true23, %if.end15
57 br label %land.lhs.true49
59 land.lhs.true49: ; preds = %for.cond1.for.inc44_crit_edge, %for.cond1.preheader
60 %2 = load i32, i32* @output_flags, align 4
61 %and50 = and i32 %2, 2
62 %tobool51 = icmp eq i32 %and50, 0
63 br i1 %tobool51, label %cleanup, label %if.then52
65 if.then52: ; preds = %land.lhs.true49
68 cleanup: ; preds = %if.then52, %land.lhs.true49, %entry.split
69 call void @llvm.lifetime.end(i64 24, i8* %0)
73 declare void @llvm.lifetime.end(i64, i8* nocapture)