1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt %s -passes='function(scalarizer)' -S -o - | FileCheck %s
7 ; CHECK-LABEL: define void @foo() {
8 ; CHECK-NEXT: br label [[BB1:%.*]]
10 ; CHECK-NEXT: br label [[BB1]]
12 ; CHECK-NEXT: [[BB2_VEC_I1:%.*]] = phi i16 [ 200, [[TMP0:%.*]] ], [ [[BB2_VEC_I1]], [[BB2:%.*]] ]
13 ; CHECK-NEXT: br i1 undef, label [[BB3:%.*]], label [[BB2]]
15 ; CHECK-NEXT: ret void
20 %bb2_vec = shufflevector <2 x i16> <i16 0, i16 10000>, <2 x i16> %bb1_vec, <2 x i32> <i32 0, i32 3>
23 bb1: ; preds = %bb2, %0
24 %bb1_vec = phi <2 x i16> [ <i16 100, i16 200>, %0 ], [ %bb2_vec, %bb2 ]
25 br i1 undef, label %bb3, label %bb2
31 ; See https://reviews.llvm.org/D83101#2135945
32 define void @f1_crash(<2 x i16> %base, i1 %c, ptr %ptr) {
33 ; CHECK-LABEL: define void @f1_crash
34 ; CHECK-SAME: (<2 x i16> [[BASE:%.*]], i1 [[C:%.*]], ptr [[PTR:%.*]]) {
35 ; CHECK-NEXT: vector.ph:
36 ; CHECK-NEXT: [[BASE_I0:%.*]] = extractelement <2 x i16> [[BASE]], i64 0
37 ; CHECK-NEXT: [[BASE_I1:%.*]] = extractelement <2 x i16> [[BASE]], i64 1
38 ; CHECK-NEXT: br label [[VECTOR_BODY115:%.*]]
39 ; CHECK: vector.body115:
40 ; CHECK-NEXT: [[VECTOR_RECUR_I0:%.*]] = phi i16 [ [[BASE_I0]], [[VECTOR_PH:%.*]] ], [ [[WIDE_LOAD125_I0:%.*]], [[VECTOR_BODY115]] ]
41 ; CHECK-NEXT: [[VECTOR_RECUR_I1:%.*]] = phi i16 [ [[BASE_I1]], [[VECTOR_PH]] ], [ [[WIDE_LOAD125_I1:%.*]], [[VECTOR_BODY115]] ]
42 ; CHECK-NEXT: [[WIDE_LOAD125:%.*]] = load <2 x i16>, ptr [[PTR]], align 1
43 ; CHECK-NEXT: [[WIDE_LOAD125_I0]] = extractelement <2 x i16> [[WIDE_LOAD125]], i64 0
44 ; CHECK-NEXT: [[WIDE_LOAD125_I1]] = extractelement <2 x i16> [[WIDE_LOAD125]], i64 1
45 ; CHECK-NEXT: br i1 [[C]], label [[MIDDLE_BLOCK113:%.*]], label [[VECTOR_BODY115]]
46 ; CHECK: middle.block113:
47 ; CHECK-NEXT: ret void
51 br label %vector.body115
54 %vector.recur = phi <2 x i16> [ %base, %vector.ph ], [ %wide.load125, %vector.body115 ]
55 %wide.load125 = load <2 x i16>, ptr %ptr, align 1
56 br i1 %c, label %middle.block113, label %vector.body115