1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=aarch64-unknown-linux-gnu -mcpu=cortex-a57 | FileCheck %s
3 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
4 target triple = "aarch64--linux-gnu"
6 define void @test1(ptr noalias nocapture %a, ptr noalias nocapture readonly %b, ptr noalias nocapture readonly %c) {
9 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr [[B:%.*]], align 4
10 ; CHECK-NEXT: [[TMP3:%.*]] = load <4 x i32>, ptr [[C:%.*]], align 4
11 ; CHECK-NEXT: [[TMP4:%.*]] = add nsw <4 x i32> [[TMP3]], [[TMP1]]
12 ; CHECK-NEXT: [[TMP5:%.*]] = sdiv <4 x i32> [[TMP4]], <i32 2, i32 2, i32 2, i32 2>
13 ; CHECK-NEXT: store <4 x i32> [[TMP5]], ptr [[A:%.*]], align 4
14 ; CHECK-NEXT: ret void
17 %0 = load i32, ptr %b, align 4
18 %1 = load i32, ptr %c, align 4
19 %add = add nsw i32 %1, %0
20 %div = sdiv i32 %add, 2
21 store i32 %div, ptr %a, align 4
22 %arrayidx3 = getelementptr inbounds i32, ptr %b, i64 1
23 %2 = load i32, ptr %arrayidx3, align 4
24 %arrayidx4 = getelementptr inbounds i32, ptr %c, i64 1
25 %3 = load i32, ptr %arrayidx4, align 4
26 %add5 = add nsw i32 %3, %2
27 %div6 = sdiv i32 %add5, 2
28 %arrayidx7 = getelementptr inbounds i32, ptr %a, i64 1
29 store i32 %div6, ptr %arrayidx7, align 4
30 %arrayidx8 = getelementptr inbounds i32, ptr %b, i64 2
31 %4 = load i32, ptr %arrayidx8, align 4
32 %arrayidx9 = getelementptr inbounds i32, ptr %c, i64 2
33 %5 = load i32, ptr %arrayidx9, align 4
34 %add10 = add nsw i32 %5, %4
35 %div11 = sdiv i32 %add10, 2
36 %arrayidx12 = getelementptr inbounds i32, ptr %a, i64 2
37 store i32 %div11, ptr %arrayidx12, align 4
38 %arrayidx13 = getelementptr inbounds i32, ptr %b, i64 3
39 %6 = load i32, ptr %arrayidx13, align 4
40 %arrayidx14 = getelementptr inbounds i32, ptr %c, i64 3
41 %7 = load i32, ptr %arrayidx14, align 4
42 %add15 = add nsw i32 %7, %6
43 %div16 = sdiv i32 %add15, 2
44 %arrayidx17 = getelementptr inbounds i32, ptr %a, i64 3
45 store i32 %div16, ptr %arrayidx17, align 4