xref: /llvm-project/polly/test/CodeGen/entry_with_trivial_phi_other_bb.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1; RUN: opt %loadNPMPolly -passes=polly-codegen -S < %s | FileCheck %s
2;
3; The entry of this scop's simple region (entry.split => for.end) has an trivial
4; PHI node that is used in a different of the scop region. LCSSA may create such
5; PHI nodes. This is a breakdown of this case in the function 'mp_unexp_sub' of
6; pifft from LLVM's test-suite.
7;
8target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9
10define void @test(i64 %n, ptr noalias nonnull %A, float %a) {
11entry:
12  br label %entry.split
13
14; CHECK-LABEL: polly.start:
15; CHECK:         store float %a, ptr %b.phiops
16
17entry.split:
18  %b = phi float [ %a, %entry ]
19  %cmp2 = icmp slt i64 %n, 5
20  br i1 %cmp2, label %for.cond, label %for.end
21
22for.cond:                                         ; preds = %for.inc, %entry
23  %i.0 = phi i64 [ 0, %entry.split ], [ %add, %for.inc ]
24  %cmp = icmp slt i64 %i.0, %n
25  br i1 %cmp, label %for.body, label %for.end
26
27for.body:                                         ; preds = %for.cond
28  %arrayidx = getelementptr inbounds float, ptr %A, i64 %i.0
29  store float %b, ptr %arrayidx, align 4
30  br label %for.inc
31
32for.inc:                                          ; preds = %for.body
33  %add = add nuw nsw i64 %i.0, 1
34  br label %for.cond
35
36for.end:                                          ; preds = %for.cond
37  ret void
38}
39