~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Transforms/LoopVectorize/start-non-zero.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: opt < %s -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -instcombine -S | FileCheck %s
 
2
 
 
3
target 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"
 
4
target triple = "x86_64-apple-macosx10.8.0"
 
5
 
 
6
;CHECK-LABEL: @start_at_nonzero(
 
7
;CHECK: mul nuw <4 x i32>
 
8
;CHECK: ret i32
 
9
define i32 @start_at_nonzero(i32* nocapture %a, i32 %start, i32 %end) nounwind uwtable ssp {
 
10
entry:
 
11
  %cmp3 = icmp slt i32 %start, %end
 
12
  br i1 %cmp3, label %for.body.lr.ph, label %for.end
 
13
 
 
14
for.body.lr.ph:                                   ; preds = %entry
 
15
  %0 = sext i32 %start to i64
 
16
  br label %for.body
 
17
 
 
18
for.body:                                         ; preds = %for.body.lr.ph, %for.body
 
19
  %indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
 
20
  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
 
21
  %1 = load i32, i32* %arrayidx, align 4
 
22
  %mul = mul nuw i32 %1, 333
 
23
  store i32 %mul, i32* %arrayidx, align 4
 
24
  %indvars.iv.next = add i64 %indvars.iv, 1
 
25
  %2 = trunc i64 %indvars.iv.next to i32
 
26
  %cmp = icmp slt i32 %2, %end
 
27
  br i1 %cmp, label %for.body, label %for.end
 
28
 
 
29
for.end:                                          ; preds = %for.body, %entry
 
30
  ret i32 4
 
31
}