1 ; RUN: opt -S -passes='loop(indvars)' -verify-scev < %s | FileCheck %s
6 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
7 target triple = "x86_64-unknown-linux-gnu"
9 define void @test_01(i1 %b) {
10 ; CHECK-LABEL: test_01
12 %b.ext = zext i1 %b to i32
13 %zero = and i32 %b.ext, 2
14 %precond = icmp ne i32 %zero, 0
15 call void @llvm.assume(i1 %precond)
19 %iv = phi i16 [ 0, %entry ], [ %iv.next, %loop ]
20 %iv.next = add i16 %iv, 1
21 %cond = icmp slt i16 %iv, 1
22 br i1 %cond, label %loop, label %exit
28 define void @test_02() {
29 ; CHECK-LABEL: test_02
31 %tmp = and i1 false, undef
32 br i1 %tmp, label %preheader, label %unreached
34 preheader: ; preds = %entry
37 loop: ; preds = %loop, %preheader
38 %tmp3 = phi i32 [ 2, %preheader ], [ %tmp4, %loop ]
39 %tmp4 = add nuw nsw i32 %tmp3, 1
40 %tmp5 = icmp ugt i32 %tmp3, 74
41 br i1 %tmp5, label %unreached, label %loop
43 unreached: ; preds = %loop
47 declare void @llvm.assume(i1)