• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -basicaa -slp-vectorizer -slp-threshold=1000 -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
2
3target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
4target triple = "x86_64-apple-macosx10.8.0"
5
6; Check that the command line flag works.
7;CHECK:rollable
8;CHECK-NOT:load <4 x i32>
9;CHECK: ret
10
11define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i64 %n) {
12  %1 = icmp eq i64 %n, 0
13  br i1 %1, label %._crit_edge, label %.lr.ph
14
15.lr.ph:                                           ; preds = %0, %.lr.ph
16  %i.019 = phi i64 [ %26, %.lr.ph ], [ 0, %0 ]
17  %2 = shl i64 %i.019, 2
18  %3 = getelementptr inbounds i32, i32* %in, i64 %2
19  %4 = load i32, i32* %3, align 4
20  %5 = or i64 %2, 1
21  %6 = getelementptr inbounds i32, i32* %in, i64 %5
22  %7 = load i32, i32* %6, align 4
23  %8 = or i64 %2, 2
24  %9 = getelementptr inbounds i32, i32* %in, i64 %8
25  %10 = load i32, i32* %9, align 4
26  %11 = or i64 %2, 3
27  %12 = getelementptr inbounds i32, i32* %in, i64 %11
28  %13 = load i32, i32* %12, align 4
29  %14 = mul i32 %4, 7
30  %15 = add i32 %14, 7
31  %16 = mul i32 %7, 7
32  %17 = add i32 %16, 14
33  %18 = mul i32 %10, 7
34  %19 = add i32 %18, 21
35  %20 = mul i32 %13, 7
36  %21 = add i32 %20, 28
37  %22 = getelementptr inbounds i32, i32* %out, i64 %2
38  store i32 %15, i32* %22, align 4
39  %23 = getelementptr inbounds i32, i32* %out, i64 %5
40  store i32 %17, i32* %23, align 4
41  %24 = getelementptr inbounds i32, i32* %out, i64 %8
42  store i32 %19, i32* %24, align 4
43  %25 = getelementptr inbounds i32, i32* %out, i64 %11
44  store i32 %21, i32* %25, align 4
45  %26 = add i64 %i.019, 1
46  %exitcond = icmp eq i64 %26, %n
47  br i1 %exitcond, label %._crit_edge, label %.lr.ph
48
49._crit_edge:                                      ; preds = %.lr.ph, %0
50  ret i32 undef
51}
52