1 ; RUN: opt -loop-reduce %s -o - -S | FileCheck %s
2 ; RUN: opt -passes='loop(loop-reduce)' %s -o - -S | FileCheck %s
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
6 define dso_local i32 @test1() local_unnamed_addr {
10 for.cond: ; preds = %for.inc, %entry
11 ; It's ok to modify this test in the future should be able to split critical
12 ; edges here, just noting that this is the critical edge that we care about.
13 ; CHECK: callbr void asm sideeffect "", "X,X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@test1, %cond.true.i), i8* blockaddress(@test1, %for.end))
14 ; CHECK-NEXT: to label %asm.fallthrough.i.i [label %cond.true.i, label %for.end]
15 callbr void asm sideeffect "", "X,X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@test1, %cond.true.i), i8* blockaddress(@test1, %for.end))
16 to label %asm.fallthrough.i.i [label %cond.true.i, label %for.end]
18 asm.fallthrough.i.i: ; preds = %for.cond
21 cond.true.i: ; preds = %for.cond
22 br label %do.body.i.i.do.body.i.i_crit_edge
24 do.body.i.i.do.body.i.i_crit_edge: ; preds = %do.body.i.i.do.body.i.i_crit_edge, %cond.true.i
25 %pgocount711 = phi i64 [ %0, %do.body.i.i.do.body.i.i_crit_edge ], [ 0, %cond.true.i ]
26 %0 = add nuw nsw i64 %pgocount711, 1
27 br i1 undef, label %do.body.i.i.rdrand_int.exit.i_crit_edge, label %do.body.i.i.do.body.i.i_crit_edge
29 do.body.i.i.rdrand_int.exit.i_crit_edge: ; preds = %do.body.i.i.do.body.i.i_crit_edge
30 %1 = add i64 %0, undef
31 br i1 undef, label %for.end, label %for.inc
33 for.inc: ; preds = %do.body.i.i.rdrand_int.exit.i_crit_edge
36 for.end: ; preds = %do.body.i.i.rdrand_int.exit.i_crit_edge, %for.cond
37 %pgocount.promoted24 = phi i64 [ undef, %for.cond ], [ %1, %do.body.i.i.rdrand_int.exit.i_crit_edge ]