[PATCH] D125301: [LoopVectorize] Add option to use active lane mask for loop control flow

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 04:06:06 PDT 2022


david-arm marked 6 inline comments as done.
david-arm added a comment.

In D125301#3616224 <https://reviews.llvm.org/D125301#3616224>, @paulwalker-arm wrote:

> Out of interest are the test output produced manually or via an update script.  I ask because I cannot see any of the normal headers and am wondering why.

So we've been using the update_test_checks.py to generate the CHECK lines, but then manually deleting CHECK lines after the middle.block since they were unnecessary for the tests. That reduced the amount of noise, but it does mean we can't really have the NOTE at the top of the tests to say "CHECK lines generated by update_test_checks.py".



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8697-8698
+    // to the exit block.
+    auto *NotMask = new VPInstruction(VPInstruction::Not, ALM, DL);
+    EB->appendRecipe(NotMask);
+
----------------
paulwalker-arm wrote:
> This seems a bit wasteful given it's only the first lane we care about.  perhaps `VPInstruction::BranchOnCount` could take an `invert` flag that switches the branch destinations?
It's not as trivial as you'd think passing in flags to VPInstructions. :( You have to create an IR Constant, pass it in as a 3rd VPValue argument to a VPInstruction and mark it as IR "live value in" operand. We do end up with nice code after InstCombine, since it swaps the labels around for us anyway.

If you really prefer me to go down this route I can - it's just a little awkward that's all.


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

https://reviews.llvm.org/D125301



More information about the llvm-commits mailing list