[llvm] e64ed3c - [test] autogen a couple of additional tests
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 5 18:58:22 PDT 2021
Author: Philip Reames
Date: 2021-10-05T18:58:08-07:00
New Revision: e64ed3c8dff9f458b658106dc70471c33fa444c3
URL: https://github.com/llvm/llvm-project/commit/e64ed3c8dff9f458b658106dc70471c33fa444c3
DIFF: https://github.com/llvm/llvm-project/commit/e64ed3c8dff9f458b658106dc70471c33fa444c3.diff
LOG: [test] autogen a couple of additional tests
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll
llvm/test/Transforms/JumpThreading/unreachable-loops.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll b/llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll
index e2d4303234d7c..bb7cbb054e002 100644
--- a/llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll
+++ b/llvm/test/Analysis/ScalarEvolution/trip-count-negative-stride.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
; A collection of tests which exercise SCEV's ability to compute trip counts
@@ -8,10 +9,13 @@
; Case where we wrap the induction variable (without generating poison), and
; thus can't currently compute a trip count.
-; CHECK-LABEL: Determining loop execution counts for: @ult_wrap
-; CHECK: Loop %for.body: Unpredictable backedge-taken count
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
define void @ult_wrap() {
+; CHECK-LABEL: 'ult_wrap'
+; CHECK-NEXT: Determining loop execution counts for: @ult_wrap
+; 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
@@ -27,10 +31,13 @@ for.end: ; preds = %for.body, %entry
; This IV cycles between 0, and 128, never causing the loop to exit
; (This is well defined.)
-; CHECK-LABEL: Determining loop execution counts for: @ult_infinite
-; CHECK: Loop %for.body: Unpredictable backedge-taken count
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
define void @ult_infinite() {
+; CHECK-LABEL: 'ult_infinite'
+; CHECK-NEXT: Determining loop execution counts for: @ult_infinite
+; 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
@@ -46,10 +53,13 @@ for.end: ; preds = %for.body, %entry
; Same as ult_infinite, except that the loop is ill defined due to the
; must progress attribute
-; CHECK-LABEL: Determining loop execution counts for: @ult_infinite_ub
-; CHECK: Loop %for.body: Unpredictable backedge-taken count
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
define void @ult_infinite_ub() mustprogress {
+; CHECK-LABEL: 'ult_infinite_ub'
+; CHECK-NEXT: Determining loop execution counts for: @ult_infinite_ub
+; 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
@@ -65,11 +75,15 @@ for.end: ; preds = %for.body, %entry
; Backedge is not taken
-; CHECK-LABEL: Determining loop execution counts for: @ult_129_not_taken
-; CHECK: Loop %for.body: backedge-taken count is 0
-; CHECK: Loop %for.body: max backedge-taken count is 0
-
define void @ult_129_not_taken() {
+; CHECK-LABEL: 'ult_129_not_taken'
+; CHECK-NEXT: Determining loop execution counts for: @ult_129_not_taken
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 0
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 0
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 0
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 1
+;
entry:
br label %for.body
@@ -83,11 +97,15 @@ for.end: ; preds = %for.body, %entry
ret void
}
-; CHECK-LABEL: Determining loop execution counts for: @ult_129_unknown_start
-; CHECK: Loop %for.body: backedge-taken count is (((127 + (-1 * (1 umin (127 + (-1 * %start) + (-128 umax (-127 + %start)))))<nuw><nsw> + (-1 * %start) + (-128 umax (-127 + %start))) /u -127) + (1 umin (127 + (-1 * %start) + (-128 umax (-127 + %start)))))
-; CHECK: Loop %for.body: max backedge-taken count is 1
-
define void @ult_129_unknown_start(i8 %start) mustprogress {
+; CHECK-LABEL: 'ult_129_unknown_start'
+; CHECK-NEXT: Determining loop execution counts for: @ult_129_unknown_start
+; CHECK-NEXT: Loop %for.body: backedge-taken count is (((127 + (-1 * (1 umin (127 + (-1 * %start) + (-128 umax (-127 + %start)))))<nuw><nsw> + (-1 * %start) + (-128 umax (-127 + %start))) /u -127) + (1 umin (127 + (-1 * %start) + (-128 umax (-127 + %start)))))
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is (((127 + (-1 * (1 umin (127 + (-1 * %start) + (-128 umax (-127 + %start)))))<nuw><nsw> + (-1 * %start) + (-128 umax (-127 + %start))) /u -127) + (1 umin (127 + (-1 * %start) + (-128 umax (-127 + %start)))))
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 1
+;
entry:
br label %for.body
@@ -103,11 +121,13 @@ for.end: ; preds = %for.body, %entry
; A case with a non-constant stride where the backedge is not taken
-; CHECK-LABEL: Determining loop execution counts for: @ult_not_taken
-; CHECK: Loop %for.body: Unpredictable backedge-taken count
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
-
define void @ult_not_taken(i8 %step) {
+; CHECK-LABEL: 'ult_not_taken'
+; CHECK-NEXT: Determining loop execution counts for: @ult_not_taken
+; 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:
%assume = icmp ult i8 128, %step
call void @llvm.assume(i1 %assume)
@@ -127,11 +147,15 @@ for.end: ; preds = %for.body, %entry
; IV does wrap, and thus causes us to branch on poison. This loop is
; ill defined.
-; CHECK-LABEL: Determining loop execution counts for: @ult_ub1
-; CHECK: Loop %for.body: backedge-taken count is 2
-; CHECK: Loop %for.body: max backedge-taken count is 2
-
define void @ult_ub1() {
+; CHECK-LABEL: 'ult_ub1'
+; CHECK-NEXT: Determining loop execution counts for: @ult_ub1
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 2
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 2
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 2
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 3
+;
entry:
br label %for.body
@@ -147,11 +171,15 @@ for.end: ; preds = %for.body, %entry
; This loop is ill defined because we violate the nsw flag on the first
; iteration.
-; CHECK-LABEL: Determining loop execution counts for: @ult_ub2
-; CHECK: Loop %for.body: backedge-taken count is 0
-; CHECK: Loop %for.body: max backedge-taken count is 0
-
define void @ult_ub2() {
+; CHECK-LABEL: 'ult_ub2'
+; CHECK-NEXT: Determining loop execution counts for: @ult_ub2
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 0
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 0
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 0
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 1
+;
entry:
br label %for.body
@@ -167,11 +195,15 @@ for.end: ; preds = %for.body, %entry
; Large stride, poison produced for %add on second iteration, but not
; branched on.
-; CHECK-LABEL: Determining loop execution counts for: @ult_129_preinc
-; CHECK: Loop %for.body: backedge-taken count is 1
-; CHECK: Loop %for.body: max backedge-taken count is 1
-
define void @ult_129_preinc() {
+; CHECK-LABEL: 'ult_129_preinc'
+; CHECK-NEXT: Determining loop execution counts for: @ult_129_preinc
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 1
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 2
+;
entry:
br label %for.body
@@ -185,11 +217,15 @@ for.end: ; preds = %for.body, %entry
ret void
}
-; CHECK-LABEL: Determining loop execution counts for: @ult_preinc
-; CHECK: Loop %for.body: backedge-taken count is 1
-; CHECK: Loop %for.body: max backedge-taken count is 1
-
define void @ult_preinc(i8 %step) {
+; CHECK-LABEL: 'ult_preinc'
+; CHECK-NEXT: Determining loop execution counts for: @ult_preinc
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 1
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 2
+;
entry:
%assume = icmp ult i8 128, %step
call void @llvm.assume(i1 %assume)
@@ -205,11 +241,13 @@ for.end: ; preds = %for.body, %entry
ret void
}
-; CHECK-LABEL: Determining loop execution counts for: @ult_129_varying_rhs
-; CHECK: Loop %for.body: Unpredictable backedge-taken count.
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
-
define void @ult_129_varying_rhs(i8* %n_p) {
+; CHECK-LABEL: 'ult_129_varying_rhs'
+; CHECK-NEXT: Determining loop execution counts for: @ult_129_varying_rhs
+; 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
@@ -224,11 +262,13 @@ for.end: ; preds = %for.body, %entry
ret void
}
-; CHECK-LABEL: Determining loop execution counts for: @ult_symbolic_varying_rhs
-; CHECK: Loop %for.body: Unpredictable backedge-taken count.
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
-
define void @ult_symbolic_varying_rhs(i8* %n_p, i8 %step) {
+; CHECK-LABEL: 'ult_symbolic_varying_rhs'
+; CHECK-NEXT: Determining loop execution counts for: @ult_symbolic_varying_rhs
+; 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:
%assume = icmp ult i8 128, %step
call void @llvm.assume(i1 %assume)
@@ -251,10 +291,15 @@ for.end: ; preds = %for.body, %entry
; Case where we wrap the induction variable (without generating poison), and
; thus can't currently compute a trip count.
-; CHECK-LABEL: Determining loop execution counts for: @slt_wrap
-; CHECK: Loop %for.body: backedge-taken count is 63
-; CHECK: Loop %for.body: max backedge-taken count is 63
define void @slt_wrap() {
+; CHECK-LABEL: 'slt_wrap'
+; CHECK-NEXT: Determining loop execution counts for: @slt_wrap
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 63
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 63
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 63
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 64
+;
entry:
br label %for.body
@@ -270,10 +315,13 @@ for.end: ; preds = %for.body, %entry
; This IV cycles between 0, and int_min (128), never causing the loop to exit
; (This is well defined.)
-; CHECK-LABEL: Determining loop execution counts for: @slt_infinite
-; CHECK: Loop %for.body: Unpredictable backedge-taken count
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
define void @slt_infinite() {
+; CHECK-LABEL: 'slt_infinite'
+; CHECK-NEXT: Determining loop execution counts for: @slt_infinite
+; 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
@@ -289,10 +337,13 @@ for.end: ; preds = %for.body, %entry
; Same as slt_infinite, except that the loop is ill defined due to the
; must progress attribute
-; CHECK-LABEL: Determining loop execution counts for: @slt_infinite_ub
-; CHECK: Loop %for.body: Unpredictable backedge-taken count
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
define void @slt_infinite_ub() mustprogress {
+; CHECK-LABEL: 'slt_infinite_ub'
+; CHECK-NEXT: Determining loop execution counts for: @slt_infinite_ub
+; 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
@@ -308,11 +359,15 @@ for.end: ; preds = %for.body, %entry
; Backedge is not taken
-; CHECK-LABEL: Determining loop execution counts for: @slt_129_not_taken
-; CHECK: Loop %for.body: backedge-taken count is 0
-; CHECK: Loop %for.body: max backedge-taken count is 0
-
define void @slt_129_not_taken() {
+; CHECK-LABEL: 'slt_129_not_taken'
+; CHECK-NEXT: Determining loop execution counts for: @slt_129_not_taken
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 0
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 0
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 0
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 1
+;
entry:
br label %for.body
@@ -327,11 +382,13 @@ for.end: ; preds = %for.body, %entry
}
; A case with a non-constant stride where the backedge is not taken
-; CHECK-LABEL: Determining loop execution counts for: @slt_not_taken
-; CHECK: Loop %for.body: Unpredictable backedge-taken count
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
-
define void @slt_not_taken(i8 %step) {
+; CHECK-LABEL: 'slt_not_taken'
+; CHECK-NEXT: Determining loop execution counts for: @slt_not_taken
+; 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:
%assume = icmp ult i8 128, %step
call void @llvm.assume(i1 %assume)
@@ -347,11 +404,13 @@ for.end: ; preds = %for.body, %entry
ret void
}
-; CHECK-LABEL: Determining loop execution counts for: @slt_129_unknown_start
-; CHECK: Loop %for.body: Unpredictable backedge-taken count
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
-
define void @slt_129_unknown_start(i8 %start) mustprogress {
+; CHECK-LABEL: 'slt_129_unknown_start'
+; CHECK-NEXT: Determining loop execution counts for: @slt_129_unknown_start
+; 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
@@ -368,11 +427,15 @@ for.end: ; preds = %for.body, %entry
; IV does wrap, and thus causes us to branch on poison. This loop is
; ill defined.
-; CHECK-LABEL: Determining loop execution counts for: @slt_ub
-; CHECK: Loop %for.body: backedge-taken count is false
-; CHECK: Loop %for.body: max backedge-taken count is false
-
define void @slt_ub1() {
+; CHECK-LABEL: 'slt_ub1'
+; CHECK-NEXT: Determining loop execution counts for: @slt_ub1
+; CHECK-NEXT: Loop %for.body: backedge-taken count is false
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is false
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is false
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 1
+;
entry:
br label %for.body
@@ -388,11 +451,15 @@ for.end: ; preds = %for.body, %entry
; This loop is ill defined because we violate the nsw flag on the first
; iteration.
-; CHECK-LABEL: Determining loop execution counts for: @slt_ub2
-; CHECK: Loop %for.body: backedge-taken count is false
-; CHECK: Loop %for.body: max backedge-taken count is false
-
define void @slt_ub2() {
+; CHECK-LABEL: 'slt_ub2'
+; CHECK-NEXT: Determining loop execution counts for: @slt_ub2
+; CHECK-NEXT: Loop %for.body: backedge-taken count is false
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is false
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is false
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 1
+;
entry:
br label %for.body
@@ -408,11 +475,15 @@ for.end: ; preds = %for.body, %entry
; Large stride, poison produced for %add on second iteration, but not
; branched on.
-; CHECK-LABEL: Determining loop execution counts for: @slt_129_preinc
-; CHECK: Loop %for.body: backedge-taken count is 1
-; CHECK: Loop %for.body: max backedge-taken count is 1
-
define void @slt_129_preinc() {
+; CHECK-LABEL: 'slt_129_preinc'
+; CHECK-NEXT: Determining loop execution counts for: @slt_129_preinc
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 1
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 2
+;
entry:
br label %for.body
@@ -426,11 +497,15 @@ for.end: ; preds = %for.body, %entry
ret void
}
-; CHECK-LABEL: Determining loop execution counts for: @slt_preinc
-; CHECK: Loop %for.body: backedge-taken count is 1
-; CHECK: Loop %for.body: max backedge-taken count is 1
-
define void @slt_preinc(i8 %step) {
+; CHECK-LABEL: 'slt_preinc'
+; CHECK-NEXT: Determining loop execution counts for: @slt_preinc
+; CHECK-NEXT: Loop %for.body: backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: max backedge-taken count is 1
+; CHECK-NEXT: Loop %for.body: Predicated backedge-taken count is 1
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %for.body: Trip multiple is 2
+;
entry:
%assume = icmp ult i8 128, %step
call void @llvm.assume(i1 %assume)
@@ -446,11 +521,13 @@ for.end: ; preds = %for.body, %entry
ret void
}
-; CHECK-LABEL: Determining loop execution counts for: @slt_129_varying_rhs
-; CHECK: Loop %for.body: Unpredictable backedge-taken count.
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
-
define void @slt_129_varying_rhs(i8* %n_p) {
+; CHECK-LABEL: 'slt_129_varying_rhs'
+; CHECK-NEXT: Determining loop execution counts for: @slt_129_varying_rhs
+; 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
@@ -465,11 +542,13 @@ for.end: ; preds = %for.body, %entry
ret void
}
-; CHECK-LABEL: Determining loop execution counts for: @slt_symbolic_varying_rhs
-; CHECK: Loop %for.body: Unpredictable backedge-taken count.
-; CHECK: Loop %for.body: Unpredictable max backedge-taken count
-
define void @slt_symbolic_varying_rhs(i8* %n_p, i8 %step) {
+; CHECK-LABEL: 'slt_symbolic_varying_rhs'
+; CHECK-NEXT: Determining loop execution counts for: @slt_symbolic_varying_rhs
+; 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:
%assume = icmp ult i8 128, %step
call void @llvm.assume(i1 %assume)
diff --git a/llvm/test/Transforms/JumpThreading/unreachable-loops.ll b/llvm/test/Transforms/JumpThreading/unreachable-loops.ll
index a0f1c21272095..cd5c62915dbd4 100644
--- a/llvm/test/Transforms/JumpThreading/unreachable-loops.ll
+++ b/llvm/test/Transforms/JumpThreading/unreachable-loops.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -jump-threading -S < %s | FileCheck %s
; RUN: opt -passes=jump-threading -S < %s | FileCheck %s
@@ -6,7 +7,21 @@
; profile metadata from a phi node.
define void @unreachable_single_bb_loop() {
+;
; CHECK-LABEL: @unreachable_single_bb_loop(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[TMP:%.*]] = call i32 @a()
+; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP]], 1
+; CHECK-NEXT: br i1 [[TMP1]], label [[BB8:%.*]], label [[BB8]]
+; CHECK: bb2:
+; CHECK-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP]], 1
+; CHECK-NEXT: switch i1 [[TMP4]], label [[BB2:%.*]] [
+; CHECK-NEXT: i1 false, label [[BB8]]
+; CHECK-NEXT: i1 true, label [[BB8]]
+; CHECK-NEXT: ]
+; CHECK: bb8:
+; CHECK-NEXT: ret void
+;
bb:
%tmp = call i32 @a()
%tmp1 = icmp eq i32 %tmp, 1
@@ -32,7 +47,23 @@ bb8: ; preds = %bb8, %bb7, %bb5, %b
}
define void @unreachable_multi_bbs_loop() {
+;
; CHECK-LABEL: @unreachable_multi_bbs_loop(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[TMP:%.*]] = call i32 @a()
+; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP]], 1
+; CHECK-NEXT: br i1 [[TMP1]], label [[BB8:%.*]], label [[BB8]]
+; CHECK: bb3:
+; CHECK-NEXT: br label [[BB2:%.*]]
+; CHECK: bb2:
+; CHECK-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP]], 1
+; CHECK-NEXT: switch i1 [[TMP4]], label [[BB3:%.*]] [
+; CHECK-NEXT: i1 false, label [[BB8]]
+; CHECK-NEXT: i1 true, label [[BB8]]
+; CHECK-NEXT: ]
+; CHECK: bb8:
+; CHECK-NEXT: ret void
+;
bb:
%tmp = call i32 @a()
%tmp1 = icmp eq i32 %tmp, 1
@@ -65,7 +96,15 @@ declare i32 @a()
; to hang - an insertelement instruction has itself as an operand.
define void @PR48362() {
+;
; CHECK-LABEL: @PR48362(
+; CHECK-NEXT: cleanup.cont1500:
+; CHECK-NEXT: unreachable
+; CHECK: if.end1733:
+; CHECK-NEXT: [[I82:%.*]] = load i32, i32* undef, align 1
+; CHECK-NEXT: [[TOBOOL1731_NOT:%.*]] = icmp eq i32 [[I82]], 0
+; CHECK-NEXT: br label [[IF_END1733:%.*]]
+;
cleanup1491: ; preds = %for.body1140
switch i32 0, label %cleanup2343.loopexit4 [
i32 0, label %cleanup.cont1500
More information about the llvm-commits
mailing list