1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -passes=slp-vectorizer < %s -o - -S | FileCheck %s
4 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx15.4.0"
7 define fastcc i32 @rdar128092379(i8 %index) {
8 ; CHECK-LABEL: define fastcc i32 @rdar128092379(
9 ; CHECK-SAME: i8 [[INDEX:%.*]]) {
10 ; CHECK-NEXT: [[BLOCK:.*]]:
11 ; CHECK-NEXT: [[ZEXT:%.*]] = zext i8 [[INDEX]] to i64
12 ; CHECK-NEXT: [[ZEXT1:%.*]] = zext i8 [[INDEX]] to i64
13 ; CHECK-NEXT: br label %[[BLOCK3:.*]]
14 ; CHECK: [[BLOCK2:.*]]:
15 ; CHECK-NEXT: br label %[[BLOCK3]]
17 ; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ 0, %[[BLOCK2]] ], [ [[ZEXT1]], %[[BLOCK]] ]
18 ; CHECK-NEXT: [[PHI4:%.*]] = phi i64 [ 0, %[[BLOCK2]] ], [ [[ZEXT]], %[[BLOCK]] ]
19 ; CHECK-NEXT: [[EXTRACTELEMENT:%.*]] = extractelement <16 x i32> zeroinitializer, i64 [[PHI4]]
20 ; CHECK-NEXT: [[EXTRACTELEMENT5:%.*]] = extractelement <16 x i32> zeroinitializer, i64 [[PHI]]
21 ; CHECK-NEXT: [[SUM:%.*]] = add i32 [[EXTRACTELEMENT]], [[EXTRACTELEMENT5]]
22 ; CHECK-NEXT: ret i32 [[SUM]]
25 %zext = zext i8 %index to i64
26 %zext1 = zext i8 %index to i64
33 %phi = phi i64 [ 0, %block2 ], [ %zext1, %block ]
34 %phi4 = phi i64 [ 0, %block2 ], [ %zext, %block ]
35 %extractelement = extractelement <16 x i32> zeroinitializer, i64 %phi4
36 %extractelement5 = extractelement <16 x i32> zeroinitializer, i64 %phi
37 %sum = add i32 %extractelement, %extractelement5