• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; REQUIRES: asserts
2; RUN: opt -S -loop-vectorize -debug-only=loop-vectorize -mcpu=skylake %s 2>&1 | FileCheck %s
3target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
4target triple = "i386-unknown-linux-gnu"
5
6@doublesrc = common local_unnamed_addr global [120 x double] zeroinitializer, align 4
7@doubledst = common local_unnamed_addr global [120 x double] zeroinitializer, align 4
8
9; Function Attrs: norecurse nounwind
10define void @stride2double(double %k, i32 %width_) {
11entry:
12
13; CHECK: Found an estimated cost of 8 for VF 4 For instruction:   %0 = load double
14; CHECK: Found an estimated cost of 8 for VF 4 For instruction:   store double
15
16  %cmp27 = icmp sgt i32 %width_, 0
17  br i1 %cmp27, label %for.body.lr.ph, label %for.cond.cleanup
18
19for.body.lr.ph:                                   ; preds = %entry
20  br label %for.body
21
22for.cond.cleanup:                                 ; preds = %for.body, %entry
23  ret void
24
25for.body:                                         ; preds = %for.body.lr.ph, %for.body
26  %i.028 = phi i32 [ 0, %for.body.lr.ph ], [ %add16, %for.body ]
27  %arrayidx = getelementptr inbounds [120 x double], [120 x double]* @doublesrc, i32 0, i32 %i.028
28  %0 = load double, double* %arrayidx, align 4
29  %arrayidx2 = getelementptr inbounds [120 x double], [120 x double]* @doubledst, i32 0, i32 %i.028
30  store double %0, double* %arrayidx2, align 4
31  %add4 = add nuw nsw i32 %i.028, 1
32  %arrayidx5 = getelementptr inbounds [120 x double], [120 x double]* @doublesrc, i32 0, i32 %add4
33  %1 = load double, double* %arrayidx5, align 4
34  %arrayidx8 = getelementptr inbounds [120 x double], [120 x double]* @doubledst, i32 0, i32 %add4
35  store double %1, double* %arrayidx8, align 4
36  %add16 = add nuw nsw i32 %i.028, 2
37  %cmp = icmp slt i32 %add16, %width_
38  br i1 %cmp, label %for.body, label %for.cond.cleanup
39}
40
41