1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -S %s | FileCheck %s
4 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
5 target triple = "arm64-apple-ios13.0.0"
10 define void @test(ptr %ptr, ptr noalias %res) {
13 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
15 ; CHECK-NEXT: [[CALL_I_I:%.*]] = call ptr @get_ptr()
16 ; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr i32, ptr [[CALL_I_I]], i32 2
17 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i32>, ptr [[CALL_I_I]], align 2
18 ; CHECK-NEXT: [[TMP3:%.*]] = load <2 x i32>, ptr [[GEP_1]], align 2
19 ; CHECK-NEXT: [[TMP4:%.*]] = zext <2 x i32> [[TMP1]] to <2 x i64>
20 ; CHECK-NEXT: [[TMP5:%.*]] = zext <2 x i32> [[TMP3]] to <2 x i64>
21 ; CHECK-NEXT: [[TMP6:%.*]] = sub nsw <2 x i64> [[TMP4]], [[TMP5]]
22 ; CHECK-NEXT: store <2 x i64> [[TMP6]], ptr [[RES:%.*]], align 8
23 ; CHECK-NEXT: [[C:%.*]] = call i1 @cond()
24 ; CHECK-NEXT: br i1 [[C]], label [[FOR_BODY]], label [[EXIT:%.*]]
26 ; CHECK-NEXT: ret void
31 for.body: ; preds = %for.body, %entry
32 %call.i.i = call ptr @get_ptr()
33 %l.0.0 = load i32, ptr %call.i.i, align 2
34 %gep.1 = getelementptr i32, ptr %call.i.i, i32 2
35 %l.1.0 = load i32, ptr %gep.1, align 2
36 %ext.0.0 = zext i32 %l.0.0 to i64
37 %ext.1.0 = zext i32 %l.1.0 to i64
38 %sub.1 = sub nsw i64 %ext.0.0, %ext.1.0
40 %gep.2 = getelementptr i32, ptr %call.i.i, i32 1
41 %l.0.1 = load i32, ptr %gep.2, align 2
42 %gep.3 = getelementptr i32, ptr %call.i.i, i32 3
43 %l.1.1 = load i32, ptr %gep.3, align 2
44 %ext.0.1 = zext i32 %l.0.1 to i64
45 %ext.1.1 = zext i32 %l.1.1 to i64
46 %sub.2 = sub nsw i64 %ext.0.1, %ext.1.1
48 store i64 %sub.1, ptr %res
49 %res.1 = getelementptr i64, ptr %res, i64 1
50 store i64 %sub.2, ptr %res.1
53 br i1 %c, label %for.body, label %exit