1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes='loop(loop-rotate,loop-deletion)' -S | FileCheck %s
4 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
9 ; CHECK-NEXT: br label [[L0_PREHEADER:%.*]]
10 ; CHECK: L0.L0.preheader.loopexit_crit_edge:
11 ; CHECK-NEXT: br label [[L0_PREHEADER_LOOPEXIT:%.*]]
12 ; CHECK: L0.preheader.loopexit:
13 ; CHECK-NEXT: br label [[L0_PREHEADER]]
14 ; CHECK: L0.preheader:
15 ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 0, 0
16 ; CHECK-NEXT: [[INC:%.*]] = zext i1 [[CMP]] to i32
17 ; CHECK-NEXT: [[TOBOOL3_NOT1:%.*]] = icmp eq i32 [[INC]], 0
18 ; CHECK-NEXT: br i1 [[TOBOOL3_NOT1]], label [[L0_PREHEADER_LOOPEXIT]], label [[L1_PREHEADER_LR_PH:%.*]]
19 ; CHECK: L1.preheader.lr.ph:
20 ; CHECK-NEXT: br label [[L0_L0_PREHEADER_LOOPEXIT_CRIT_EDGE:%.*]]
23 br label %L0.preheader
28 L0: ; preds = %L0.latch, %L0.preheader
29 %k.0 = phi i32 [ 0, %L0.preheader ], [ %spec.select, %L0.latch ]
30 %cmp = icmp slt i32 0, 0
31 %inc = zext i1 %cmp to i32
32 %spec.select = add nsw i32 %k.0, %inc
33 %tobool3.not = icmp eq i32 %spec.select, 0
34 br i1 %tobool3.not, label %L0.preheader, label %L1.preheader
37 %tobool8.not = icmp eq i32 %k.0, 0
41 br i1 %tobool8.not, label %L1.latch, label %L0.latch
44 br i1 false, label %L1, label %L0.latch