• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s  -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -dce -instcombine -S | 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-LABEL: @add_ints(
7;CHECK: br
8;CHECK: br
9;CHECK: getelementptr
10;CHECK-DAG: getelementptr
11;CHECK-DAG: icmp uge
12;CHECK-DAG: icmp uge
13;CHECK-DAG: icmp uge
14;CHECK-DAG: icmp uge
15;CHECK-DAG: and
16;CHECK-DAG: and
17;CHECK: br
18;CHECK: ret
19define void @add_ints(i32* nocapture %A, i32* nocapture %B, i32* nocapture %C) {
20entry:
21  br label %for.body
22
23for.body:
24  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
25  %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv
26  %0 = load i32, i32* %arrayidx, align 4
27  %arrayidx2 = getelementptr inbounds i32, i32* %C, i64 %indvars.iv
28  %1 = load i32, i32* %arrayidx2, align 4
29  %add = add nsw i32 %1, %0
30  %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
31  store i32 %add, i32* %arrayidx4, align 4
32  %indvars.iv.next = add i64 %indvars.iv, 1
33  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
34  %exitcond = icmp eq i32 %lftr.wideiv, 200
35  br i1 %exitcond, label %for.end, label %for.body
36
37for.end:
38  ret void
39}
40