• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -basicaa -slp-vectorizer < %s | FileCheck %s
2target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
3target triple = "arm64-apple-ios5.0.0"
4
5; Holding a value live over a call boundary may require
6; spills and fills. This is the case for <2 x double>,
7; as it occupies a Q register of which there are no
8; callee-saves.
9
10; CHECK: load double
11; CHECK: load double
12; CHECK: call void @g
13; CHECK: store double
14; CHECK: store double
15define void @f(double* %p, double* %q) {
16  %addr2 = getelementptr double, double* %q, i32 1
17  %addr = getelementptr double, double* %p, i32 1
18  %x = load double, double* %p
19  %y = load double, double* %addr
20  call void @g()
21  store double %x, double* %q
22  store double %y, double* %addr2
23  ret void
24}
25declare void @g()
26
27; Check we deal with loops correctly.
28;
29; CHECK: store <2 x double>
30; CHECK: load <2 x double>
31define void @f2(double* %p, double* %q) {
32entry:
33  br label %loop
34
35loop:
36  %p1 = phi double [0.0, %entry], [%x, %loop]
37  %p2 = phi double [0.0, %entry], [%y, %loop]
38  %addr2 = getelementptr double, double* %q, i32 1
39  %addr = getelementptr double, double* %p, i32 1
40  store double %p1, double* %q
41  store double %p2, double* %addr2
42
43  %x = load double, double* %p
44  %y = load double, double* %addr
45  br label %loop
46}
47