[llvm] [LoopVectorize] Enable vectorisation of early exit loops with live-outs (PR #120567)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 9 06:10:14 PST 2025
================
@@ -3662,6 +3665,13 @@ class VPRegionBlock : public VPBlockBase {
/// VPRegionBlock.
VPBlockBase *Exiting;
+ /// Hold the Early Exit block of the SEME region, if one exists.
+ VPBasicBlock *EarlyExit;
+
+ /// If one exists, this keeps track of the vector early mask that triggered
+ /// the early exit.
+ VPValue *VectorEarlyExitCond;
+
/// An indicator whether this region is to generate multiple replicated
----------------
david-arm wrote:
I've rewritten this so that we don't need to stash the `EarlyExit` and `VectorEarlyExitCond` variables. Instead, I've added a `getEarlyExit` that walks through the VPBasicBlocks to find the vector.early.exit block. I also added code in `addUsersInExitBlocks` to work backwards from the early exit block to find the early exit mask. It's uglier, but it does avoid having to track these variables and maintain them during cloning, etc. Hope that's prefereable for you!
https://github.com/llvm/llvm-project/pull/120567
More information about the llvm-commits
mailing list