[PATCH] D111846: [LV] Drop integer poison-generating flags from instructions that need predication
Nuno Lopes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 3 06:53:01 PDT 2021
nlopes added a comment.
Looks good to me. Added a couple of suggestions to the code.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3034
+ // VPWidenMemoryInstructionRecipe or VPInterleaveRecipe.
+ while (!Worklist.empty()) {
+ VPValue *CurDef = Worklist.back();
----------------
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)
================
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.
----------------
An address computation may depend on float operations. e.g. you may have a float -> int, a select based on a float comparison, etc.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3056
+ return true;
+
+ for (auto *SingleDef : RecBase->definedValues())
----------------
you don't need to consider users of loads (nor of stores). you can break here if you want if WidenMemRec != nullptr.
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