[PATCH] D45271: [LV] Introduce TTI::getMinimumVF

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 12:00:31 PDT 2018


hsaito added a comment.

I think TTI part also looks reasonable, but I'll wait for Craig or others to comment on that.



================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:6163
     }
+    if (unsigned MinVF = TTI.getMinimumVF(SmallestType)) {
+      if (MaxVF < MinVF) {
----------------
This change in the vectorizer looks reasonable to me.


================
Comment at: test/Transforms/LoopVectorize/Hexagon/minimum-vf.ll:1
+; RUN: opt -march=hexagon -loop-vectorize -hexagon-autohvx -debug-only=loop-vectorize -disable-output < %s 2>&1 | FileCheck %s
+; REQUIRES: asserts
----------------
Sorry for being picky.

I happen to think this test is somehow unnecessarily large. Can't we have a much smaller/simpler test case? I think all we need is widest type guiding to less than 64 and/or constant trip guiding to less than 64, right? Or am I missing a point?


================
Comment at: test/Transforms/LoopVectorize/Hexagon/minimum-vf.ll:5
+; Check that TTI::getMinimumVF works.
+; CHECK: LV: Overriding calculated MaxVF(9) with target's minimum: 64
+
----------------
Please add a comment saying that hard coded 9 comes from the constant trip count, in case someone has to maintain the test case and/or validation later.



Repository:
  rL LLVM

https://reviews.llvm.org/D45271





More information about the llvm-commits mailing list