; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-
-; RUN: opt %s -passes='print<scalar-evolution>' -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
+; RUN: opt %s -passes='print<scalar-evolution>' -scalar-evolution-classify-expressions=0 -disable-output 2>&1 | FileCheck %s
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
ret void
}
+define void @test_zext(i64 %N) mustprogress {
+; CHECK-LABEL: 'test_zext'
+; CHECK-NEXT: Determining loop execution counts for: @test_zext
+; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable max backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count.
+;
+entry:
+ br label %for.body
+
+for.body:
+ %iv = phi i32 [ %iv.next, %for.body ], [ 0, %entry ]
+ %iv.next = add i32 %iv, 2
+ %zext = zext i32 %iv to i64
+ %cmp = icmp ne i64 %zext, %N
+ br i1 %cmp, label %for.body, label %for.cond.cleanup
+
+for.cond.cleanup:
+ ret void
+}
+
+define void @test_sext(i64 %N) mustprogress {
+; CHECK-LABEL: 'test_sext'
+; CHECK-NEXT: Determining loop execution counts for: @test_sext
+; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable max backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count.
+;
+entry:
+ br label %for.body
+
+for.body:
+ %iv = phi i32 [ %iv.next, %for.body ], [ 0, %entry ]
+ %iv.next = add i32 %iv, 2
+ %sext = sext i32 %iv to i64
+ %cmp = icmp ne i64 %sext, %N
+ br i1 %cmp, label %for.body, label %for.cond.cleanup
+
+for.cond.cleanup:
+ ret void
+}
+
+define void @test_zext_of_sext(i64 %N) mustprogress {
+; CHECK-LABEL: 'test_zext_of_sext'
+; CHECK-NEXT: Determining loop execution counts for: @test_zext_of_sext
+; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable max backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count.
+;
+entry:
+ br label %for.body
+for.body:
+ %iv = phi i32 [ %iv.next, %for.body ], [ 0, %entry ]
+ %iv.next = add i32 %iv, 2
+ %sext = sext i32 %iv to i48
+ %zext = zext i48 %sext to i64
+ %cmp = icmp ne i64 %zext, %N
+ br i1 %cmp, label %for.body, label %for.cond.cleanup
+
+for.cond.cleanup:
+ ret void
+}
+
+define void @test_zext_offset(i64 %N) mustprogress {
+; CHECK-LABEL: 'test_zext_offset'
+; CHECK-NEXT: Determining loop execution counts for: @test_zext_offset
+; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable max backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count.
+;
+entry:
+ br label %for.body
+
+for.body:
+ %iv = phi i32 [ %iv.next, %for.body ], [ 0, %entry ]
+ %iv.next = add i32 %iv, 2
+ %zext = zext i32 %iv to i64
+ %offset = add i64 %zext, 21
+ %cmp = icmp ne i64 %offset, %N
+ br i1 %cmp, label %for.body, label %for.cond.cleanup
+
+for.cond.cleanup:
+ ret void
+}
+
+define void @test_sext_offset(i64 %N) mustprogress {
+; CHECK-LABEL: 'test_sext_offset'
+; CHECK-NEXT: Determining loop execution counts for: @test_sext_offset
+; CHECK-NEXT: Loop %for.body: Unpredictable backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable max backedge-taken count.
+; CHECK-NEXT: Loop %for.body: Unpredictable predicated backedge-taken count.
+;
+entry:
+ br label %for.body
+
+for.body:
+ %iv = phi i32 [ %iv.next, %for.body ], [ 0, %entry ]
+ %iv.next = add i32 %iv, 2
+ %sext = sext i32 %iv to i64
+ %offset = add i64 %sext, 21
+ %cmp = icmp ne i64 %offset, %N
+ br i1 %cmp, label %for.body, label %for.cond.cleanup
+
+for.cond.cleanup:
+ ret void
+}