[PATCH] D111846: [LV] Drop integer poison-generating flags from instructions that need predication

Diego Caballero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 07:17:35 PDT 2021


dcaballe added a comment.

Please, let me know if there is any other comment.

Thanks!



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3034
+  // VPWidenMemoryInstructionRecipe or VPInterleaveRecipe.
+  while (!Worklist.empty()) {
+    VPValue *CurDef = Worklist.back();
----------------
nlopes wrote:
> isn't it inefficient to recompute this information for every operation? You get a O(n^2) behavior (up to n calls of this function, each traversing up to n instructions) 
I changed the approach so that we gather the target recipes before executing the VPlan. 


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3041
+
+    // Address computation should only happen on integer types.
+    // TODO: Retrieve the type from the VPRecipes/VPInstructions when available.
----------------
nlopes wrote:
> An address computation may depend on float operations. e.g. you may have a float -> int, a select based on a float comparison, etc.
True, removed that check.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3056
+          return true;
+
+        for (auto *SingleDef : RecBase->definedValues())
----------------
nlopes wrote:
> you don't need to consider users of loads (nor of stores). you can break here if you want if WidenMemRec != nullptr.
It makes sense. Done. Updating doc accordingly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111846



More information about the llvm-commits mailing list