1 ; RUN: opt < %s -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -dce -instcombine -S | FileCheck %s
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-unknown-linux-gnu"
10 ; Function Attrs: nounwind uwtable
11 define void @foo(i32* nocapture %a, i32* nocapture %b, i32 %k, i32 %m) #0 {
13 %cmp27 = icmp sgt i32 %m, 0
14 br i1 %cmp27, label %for.body3.lr.ph.us, label %for.end15
16 for.end.us: ; preds = %for.body3.us
17 %arrayidx9.us = getelementptr inbounds i32, i32* %b, i64 %indvars.iv33
18 %0 = load i32, i32* %arrayidx9.us, align 4, !llvm.mem.parallel_loop_access !3
19 %add10.us = add nsw i32 %0, 3
20 store i32 %add10.us, i32* %arrayidx9.us, align 4, !llvm.mem.parallel_loop_access !3
21 %indvars.iv.next34 = add i64 %indvars.iv33, 1
22 %lftr.wideiv35 = trunc i64 %indvars.iv.next34 to i32
23 %exitcond36 = icmp eq i32 %lftr.wideiv35, %m
24 br i1 %exitcond36, label %for.end15, label %for.body3.lr.ph.us, !llvm.loop !5
26 for.body3.us: ; preds = %for.body3.us, %for.body3.lr.ph.us
27 %indvars.iv29 = phi i64 [ 0, %for.body3.lr.ph.us ], [ %indvars.iv.next30, %for.body3.us ]
28 %1 = trunc i64 %indvars.iv29 to i32
29 %add4.us = add i32 %add.us, %1
30 %idxprom.us = sext i32 %add4.us to i64
31 %arrayidx.us = getelementptr inbounds i32, i32* %a, i64 %idxprom.us
32 %2 = load i32, i32* %arrayidx.us, align 4, !llvm.mem.parallel_loop_access !3
33 %add5.us = add nsw i32 %2, 1
34 store i32 %add5.us, i32* %arrayidx7.us, align 4, !llvm.mem.parallel_loop_access !3
35 %indvars.iv.next30 = add i64 %indvars.iv29, 1
36 %lftr.wideiv31 = trunc i64 %indvars.iv.next30 to i32
37 %exitcond32 = icmp eq i32 %lftr.wideiv31, %m
38 br i1 %exitcond32, label %for.end.us, label %for.body3.us, !llvm.loop !4
40 for.body3.lr.ph.us: ; preds = %for.end.us, %entry
41 %indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.end.us ], [ 0, %entry ]
42 %3 = trunc i64 %indvars.iv33 to i32
43 %add.us = add i32 %3, %k
44 %arrayidx7.us = getelementptr inbounds i32, i32* %a, i64 %indvars.iv33
45 br label %for.body3.us
47 for.end15: ; preds = %for.end.us, %entry
51 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }