[PATCH] D57598: [VPLAN] Determine Vector Width programmatically.

Diego Caballero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 4 09:33:49 PST 2019


dcaballe added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:7141
+  if (!UserVF)
+    UserVF = guessVPlanVF(*L, TTI->getRegisterBitWidth(true /* Vector*/));
+
----------------
Regarding the issue with VF = 1, we are using VF = 1 to denote no vectorization and I think we should preserve that behavior. This basically means we shouldn't try to generate vector code (shouldn't invoke `getWideningDecision` et al.) with VF = 1.

I think the problem happens because we are setting `UserVF` here, instead of `VF`, and probably `1` is an unexpected value for `UserVF` (just guessing, I haven't checked it out). Maybe we should leave `UserVF` to values actually coming from the user and set `VF` instead? If you move this code to `planInVPlanNativePath`, as suggested, I think the VF = 1 problem would be fixed.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57598/new/

https://reviews.llvm.org/D57598





More information about the llvm-commits mailing list