1 ; RUN: opt %loadPolly -polly-optree -polly-opt-isl -polly-codegen -S < %s | FileCheck %s
4 ; isl codegen does not allow to generate isl_ast_expr from pw_aff which have an
5 ; empty domain. This happens in this case because the pw_aff's domain is
6 ; excluded by the SCoP's parameter context.
8 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
10 @c = external local_unnamed_addr global i8
11 @a = external local_unnamed_addr global i16
12 @b = external local_unnamed_addr global i8
16 %a.promoted = load i16, ptr @a
19 for.cond: ; preds = %for.cond3.for.end_crit_edge, %entry
20 %inc.lcssa17 = phi i16 [ 0, %for.cond3.for.end_crit_edge ], [ %a.promoted, %entry ]
23 for.body: ; preds = %for.cond
24 %conv = zext i16 %inc.lcssa17 to i32
25 %div = udiv i32 -286702568, %conv
26 br i1 undef, label %if.end, label %if.then
28 if.then: ; preds = %for.body
31 if.end: ; preds = %for.body
32 br label %for.body5.lr.ph
34 for.body5.lr.ph: ; preds = %if.end
35 %tmp = load i8, ptr @b, align 1
36 %cmp = icmp eq i32 %div, 1
37 br i1 %cmp, label %for.body5.lr.ph.split.us, label %for.body5.lr.ph.split
39 for.body5.lr.ph.split.us: ; preds = %for.body5.lr.ph
40 br label %lor.end.us.peel
42 lor.end.us.peel: ; preds = %for.body5.lr.ph.split.us
43 %inc.us.peel = add i16 %inc.lcssa17, 1
44 br i1 false, label %for.cond3.for.end_crit_edge, label %for.body5.us.peel.next
46 for.body5.us.peel.next: ; preds = %lor.end.us.peel
49 lor.end.us: ; preds = %lor.end.us, %for.body5.us.peel.next
50 %tmp1 = phi i16 [ %inc.us.peel, %for.body5.us.peel.next ], [ %inc.us, %lor.end.us ]
51 %inc.us = add i16 %tmp1, 1
52 %tobool4.us = icmp eq i16 %inc.us, 0
53 br i1 %tobool4.us, label %for.cond3.for.end_crit_edge, label %lor.end.us
55 for.body5.lr.ph.split: ; preds = %for.body5.lr.ph
56 br label %lor.end.peel
58 lor.end.peel: ; preds = %for.body5.lr.ph.split
59 %inc.peel = add i16 %inc.lcssa17, 1
60 br i1 false, label %for.cond3.for.end_crit_edge, label %for.body5.peel.next
62 for.body5.peel.next: ; preds = %lor.end.peel
65 lor.end: ; preds = %lor.end, %for.body5.peel.next
66 %tmp2 = phi i16 [ %inc.peel, %for.body5.peel.next ], [ %inc, %lor.end ]
67 %inc = add i16 %tmp2, 1
68 %tobool4 = icmp eq i16 %inc, 0
69 br i1 %tobool4, label %for.cond3.for.end_crit_edge, label %lor.end
71 for.cond3.for.end_crit_edge: ; preds = %lor.end, %lor.end.peel, %lor.end.us, %lor.end.us.peel
72 %tmp3 = phi i8 [ %tmp, %lor.end.us.peel ], [ %tmp, %lor.end.peel ], [ %tmp, %lor.end.us ], [ %tmp, %lor.end ]
78 ; The reference to @b should have been generated from an isl_ast_expr.
79 ; Because isl is unable to generate it in this case, the code generator
80 ; resorted to use the pointer argument of %tmp = load ... .
81 ; It is not important since this code will never be executed.
83 ; CHECK: polly.stmt.lor.end.us.peel:
84 ; CHECK-NEXT: %tmp_p_scalar_2 = load i8, ptr @b
85 ; CHECK-NEXT: store i8 %tmp_p_scalar_2, ptr %tmp3.phiops
86 ; CHECK-NEXT: br label %polly.merge