xref: /llvm-project/polly/test/CodeGen/create-conditional-scop.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1*e1f056f6Srahulana-quic; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -passes=polly-codegen -verify-loop-info < %s -S | FileCheck %s
235f70200SMichael Kruse
335f70200SMichael Krusetarget datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
435f70200SMichael Kruse
535f70200SMichael Kruse@A = common global [1536 x float] zeroinitializer
635f70200SMichael Kruse
735f70200SMichael Kruse; This test case used to fail, because we did not add the newly generated basic
835f70200SMichael Kruse; block %polly.start as a basic block to the surrounding loop.
935f70200SMichael Krusedefine void @foo() nounwind {
1035f70200SMichael Kruseentry:
1135f70200SMichael Kruse  br i1 undef, label %while.cond14.preheader, label %for.body7.single_entry.single_entry
1235f70200SMichael Kruse
1335f70200SMichael Krusewhile.cond14.preheader:                           ; preds = %for.inc02, %for.body7.single_entry.single_entry, %entry
1435f70200SMichael Kruse  ret void
1535f70200SMichael Kruse
1635f70200SMichael Krusefor.body7.single_entry.single_entry:              ; preds = %for.inc02, %entry
1735f70200SMichael Kruse  br i1 undef, label %while.cond14.preheader, label %while.body
1835f70200SMichael Kruse
1935f70200SMichael Krusewhile.body:                                       ; preds = %while.body, %for.body7.single_entry.single_entry
2035f70200SMichael Kruse  %indvar35 = phi i32 [ %0, %while.body ], [ 0, %for.body7.single_entry.single_entry ]
21b332499aSNikita Popov  %ptr = getelementptr [1536 x float], ptr @A, i64 0, i32 %indvar35
22b332499aSNikita Popov  store float undef, ptr %ptr
2335f70200SMichael Kruse  %0 = add i32 %indvar35, 1
2435f70200SMichael Kruse  %exitcond2 = icmp eq i32 %0, 42
2535f70200SMichael Kruse  br i1 %exitcond2, label %for.inc02, label %while.body
2635f70200SMichael Kruse
2735f70200SMichael Krusefor.inc02:                                        ; preds = %while.body
2835f70200SMichael Kruse  br i1 undef, label %while.cond14.preheader, label %for.body7.single_entry.single_entry
2935f70200SMichael Kruse}
3035f70200SMichael Kruse
3135f70200SMichael Kruse; CHECK: polly.split_new_and_old
3235f70200SMichael Kruse; CHECK: br i1 true, label %polly.start, label %while.body
33