-; RUN: opt -loop-reduce %s -o - -S | FileCheck %s
-; RUN: opt -passes='loop(loop-reduce)' %s -o - -S | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -loop-reduce %s -o - -S | FileCheck %s --check-prefix=LEGACYPM
+; RUN: opt -passes='loop(loop-reduce)' %s -o - -S | FileCheck %s --check-prefix=NEWPM
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
define dso_local i32 @test1() local_unnamed_addr {
+; LEGACYPM-LABEL: @test1(
+; LEGACYPM-NEXT: entry:
+; LEGACYPM-NEXT: br label [[FOR_COND:%.*]]
+; LEGACYPM: for.cond:
+; LEGACYPM-NEXT: callbr void asm sideeffect "", "i,i,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@test1, [[COND_TRUE_I:%.*]]), i8* blockaddress(@test1, [[FOR_END:%.*]]))
+; LEGACYPM-NEXT: to label [[ASM_FALLTHROUGH_I_I:%.*]] [label [[COND_TRUE_I]], label %for.end]
+; LEGACYPM: asm.fallthrough.i.i:
+; LEGACYPM-NEXT: unreachable
+; LEGACYPM: cond.true.i:
+; LEGACYPM-NEXT: br label [[DO_BODY_I_I_DO_BODY_I_I_CRIT_EDGE:%.*]]
+; LEGACYPM: do.body.i.i.do.body.i.i_crit_edge:
+; LEGACYPM-NEXT: [[LSR_IV:%.*]] = phi i64 [ [[LSR_IV_NEXT:%.*]], [[DO_BODY_I_I_DO_BODY_I_I_CRIT_EDGE]] ], [ undef, [[COND_TRUE_I]] ]
+; LEGACYPM-NEXT: [[LSR_IV_NEXT]] = add i64 [[LSR_IV]], 1
+; LEGACYPM-NEXT: br i1 true, label [[DO_BODY_I_I_RDRAND_INT_EXIT_I_CRIT_EDGE:%.*]], label [[DO_BODY_I_I_DO_BODY_I_I_CRIT_EDGE]]
+; LEGACYPM: do.body.i.i.rdrand_int.exit.i_crit_edge:
+; LEGACYPM-NEXT: br i1 true, label [[FOR_END]], label [[FOR_INC:%.*]]
+; LEGACYPM: for.inc:
+; LEGACYPM-NEXT: br label [[FOR_COND]]
+; LEGACYPM: for.end:
+; LEGACYPM-NEXT: [[PGOCOUNT_PROMOTED24:%.*]] = phi i64 [ undef, [[FOR_COND]] ], [ [[LSR_IV_NEXT]], [[DO_BODY_I_I_RDRAND_INT_EXIT_I_CRIT_EDGE]] ]
+; LEGACYPM-NEXT: ret i32 undef
+;
+; NEWPM-LABEL: @test1(
+; NEWPM-NEXT: entry:
+; NEWPM-NEXT: br label [[FOR_COND:%.*]]
+; NEWPM: for.cond:
+; NEWPM-NEXT: callbr void asm sideeffect "", "i,i,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@test1, [[COND_TRUE_I:%.*]]), i8* blockaddress(@test1, [[FOR_END:%.*]]))
+; NEWPM-NEXT: to label [[ASM_FALLTHROUGH_I_I:%.*]] [label [[COND_TRUE_I]], label %for.end]
+; NEWPM: asm.fallthrough.i.i:
+; NEWPM-NEXT: unreachable
+; NEWPM: cond.true.i:
+; NEWPM-NEXT: br label [[DO_BODY_I_I_DO_BODY_I_I_CRIT_EDGE:%.*]]
+; NEWPM: do.body.i.i.do.body.i.i_crit_edge:
+; NEWPM-NEXT: br i1 true, label [[DO_BODY_I_I_RDRAND_INT_EXIT_I_CRIT_EDGE:%.*]], label [[DO_BODY_I_I_DO_BODY_I_I_CRIT_EDGE]]
+; NEWPM: do.body.i.i.rdrand_int.exit.i_crit_edge:
+; NEWPM-NEXT: [[TMP0:%.*]] = add i64 1, undef
+; NEWPM-NEXT: br i1 true, label [[FOR_END]], label [[FOR_INC:%.*]]
+; NEWPM: for.inc:
+; NEWPM-NEXT: br label [[FOR_COND]]
+; NEWPM: for.end:
+; NEWPM-NEXT: [[PGOCOUNT_PROMOTED24:%.*]] = phi i64 [ undef, [[FOR_COND]] ], [ [[TMP0]], [[DO_BODY_I_I_RDRAND_INT_EXIT_I_CRIT_EDGE]] ]
+; NEWPM-NEXT: ret i32 undef
+;
entry:
br label %for.cond
for.cond: ; preds = %for.inc, %entry
; It's ok to modify this test in the future should we be able to split critical
; edges here, just noting that this is the critical edge that we care about.
-; CHECK: callbr void asm sideeffect "", "i,i,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@test1, %cond.true.i), i8* blockaddress(@test1, %for.end))
-; CHECK-NEXT: to label %asm.fallthrough.i.i [label %cond.true.i, label %for.end]
callbr void asm sideeffect "", "i,i,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@test1, %cond.true.i), i8* blockaddress(@test1, %for.end))
- to label %asm.fallthrough.i.i [label %cond.true.i, label %for.end]
+ to label %asm.fallthrough.i.i [label %cond.true.i, label %for.end]
asm.fallthrough.i.i: ; preds = %for.cond
unreachable