[PATCH] D50820: [VPlan] Implement initial vector code generation support for simple outer loops.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 5 02:54:58 PDT 2018


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

LGTM with some more nits to the test cases. The EnableVPlanNativePath sprinkled around are not ideal, but I don't think there is a better alternative and we should be able to get rid of them as we go along. Please wait a few days with submitting this, to give other people a change to raise any additional concerns.



================
Comment at: test/Transforms/LoopVectorize/outer_loop_test1.ll:17
+; RUN: opt -S -loop-vectorize -enable-vplan-native-path < %s | FileCheck %s
+; CHECK: vector.body:
+; CHECK: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32>
----------------
Using CHECK-LABEL to check for blocks gives better error messages in case of a mismatch.


================
Comment at: test/Transforms/LoopVectorize/outer_loop_test1.ll:18
+; CHECK: vector.body:
+; CHECK: call void @llvm.masked.scatter.v4i32.v4p0i32(<4 x i32>
+; CHECK: br label %[[for_loop:.+]]
----------------
could you also add checks for the generated PHIs, increments for the induction vars, address calculation and exit condition check? Same for the second test.


================
Comment at: test/Transforms/LoopVectorize/outer_loop_test1.ll:25
+; CHECK: br i1 {{.*}} label %vector.body
+; ModuleID = 't1.c'
+source_filename = "t1.c"
----------------
This line and the one below can be dropped.


================
Comment at: test/Transforms/LoopVectorize/outer_loop_test1.ll:28
+
+ at arr2 = external dso_local local_unnamed_addr global [8 x i32], align 16
+ at arr = external dso_local local_unnamed_addr global [8 x [8 x i32]], align 16
----------------
dso_local local_unnamed_addr can be dropped


================
Comment at: test/Transforms/LoopVectorize/outer_loop_test1.ll:32
+; Function Attrs: norecurse nounwind uwtable
+define dso_local void @foo(i32 %n) local_unnamed_addr #0 {
+entry:
----------------
dso_local and local_unnamed_addr #0 can be dropped, same for the comment above.


================
Comment at: test/Transforms/LoopVectorize/outer_loop_test2.ll:37
+source_filename = "s1.c"
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
----------------
IIUC the test does not rely on any X86 specifics, so this and the target triple can be dropped?


Repository:
  rL LLVM

https://reviews.llvm.org/D50820





More information about the llvm-commits mailing list