1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -irce -S | FileCheck %s
4 ; Reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26832
6 define void @scalar_after_vectorization_0() {
7 ; CHECK-LABEL: @scalar_after_vectorization_0(
8 ; CHECK-NEXT: outer.ph:
9 ; CHECK-NEXT: [[B4:%.*]] = sub i64 9223372036854775807, -9223372036854775808
10 ; CHECK-NEXT: [[B21:%.*]] = and i64 [[B4]], [[B4]]
11 ; CHECK-NEXT: [[B9:%.*]] = lshr i64 9223372036854775807, -1
12 ; CHECK-NEXT: br label [[OUTER_BODY:%.*]]
14 ; CHECK-NEXT: [[I:%.*]] = phi i64 [ 1, [[OUTER_PH:%.*]] ], [ [[I_NEXT:%.*]], [[INNER_END:%.*]] ]
15 ; CHECK-NEXT: [[T0:%.*]] = mul nuw nsw i64 [[I]], undef
16 ; CHECK-NEXT: br label [[INNER_BODY:%.*]]
18 ; CHECK-NEXT: [[J:%.*]] = phi i64 [ 1, [[OUTER_BODY]] ], [ [[T1:%.*]], [[INNER_BODY]] ]
19 ; CHECK-NEXT: [[T1]] = add nuw nsw i64 [[J]], [[T0]]
20 ; CHECK-NEXT: [[B3:%.*]] = mul i64 [[T1]], undef
21 ; CHECK-NEXT: [[B13:%.*]] = mul i64 [[B3]], 4294967296
22 ; CHECK-NEXT: [[C2:%.*]] = icmp slt i64 undef, [[B13]]
23 ; CHECK-NEXT: br i1 [[C2]], label [[INNER_BODY]], label [[INNER_END]]
25 ; CHECK-NEXT: [[B16:%.*]] = urem i64 [[B4]], [[B9]]
26 ; CHECK-NEXT: [[I_NEXT]] = add i64 [[I]], [[B16]]
27 ; CHECK-NEXT: [[C:%.*]] = icmp ult i64 [[B21]], [[I_NEXT]]
28 ; CHECK-NEXT: br i1 [[C]], label [[OUTER_BODY]], label [[OUTER_END:%.*]]
30 ; CHECK-NEXT: ret void
35 outer.body: ; preds = %inner.end, %outer.ph
36 %i = phi i64 [ 1, %outer.ph ], [ %i.next, %inner.end ]
37 %t0 = mul nuw nsw i64 %i, undef
40 inner.body: ; preds = %inner.body, %outer.body
41 %j = phi i64 [ 1, %outer.body ], [ %t1, %inner.body ]
42 %t1 = add nuw nsw i64 %j, %t0
43 %B3 = mul i64 %t1, undef
44 %B13 = mul i64 %B3, 4294967296
45 %C2 = icmp slt i64 undef, %B13
46 br i1 %C2, label %inner.body, label %inner.end
48 inner.end: ; preds = %inner.body
49 %B4 = sub i64 9223372036854775807, -9223372036854775808
50 %B21 = and i64 %B4, %B4
51 %B9 = lshr i64 9223372036854775807, -1
52 %B16 = urem i64 %B4, %B9
53 %i.next = add i64 %i, %B16
54 %C = icmp ult i64 %B21, %i.next
55 br i1 %C, label %outer.body, label %outer.end
57 outer.end: ; preds = %inner.end