[llvm] Reapply "[LV] Use ExtractLane(LastActiveLane, V) live outs when tail-folding. (#149042)" (PR #168738)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 24 01:11:42 PST 2025
================
@@ -1095,8 +1095,19 @@ class LLVM_ABI_FOR_TEST VPInstruction : public VPRecipeWithIRFlags,
AnyOf,
// Calculates the first active lane index of the vector predicate operands.
// It produces the lane index across all unrolled iterations. Unrolling will
- // add all copies of its original operand as additional operands.
+ // add all copies of its original operand as additional operands. If any of
+ // the vector predicate operands are all zeroes then this returns poison.
----------------
lukel97 wrote:
Yup, split off into #169298. After thinking about this for a bit I didn't bother adding the FirstActiveLaneZeroNotPoison opcode back, since I'm not sure if the extra complexity is worth it if we can likely optimize it away on RISC-V with e.g. tail folding whenever that's supported with early exit loops.
https://github.com/llvm/llvm-project/pull/168738
More information about the llvm-commits
mailing list