[llvm] [VPlan] Explicitly reassociate header mask in logical and (PR #180898)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 12 05:06:49 PST 2026
================
@@ -1614,6 +1605,31 @@ void VPlanTransforms::simplifyRecipes(VPlan &Plan) {
}
}
+/// Reassociate (headermask && x) && y -> headermask && (x && y) to allow the
+/// header mask to be simplified further, e.g. in optimizeEVLMasks.
+static void reassociateHeaderMask(VPlan &Plan) {
+ VPValue *HeaderMask = vputils::findHeaderMask(Plan);
+ if (!HeaderMask)
+ return;
+ SmallSetVector<VPUser *, 8> Worklist(HeaderMask->user_begin(),
+ HeaderMask->user_end());
+ while (!Worklist.empty()) {
----------------
lukel97 wrote:
I've just removed the call to R.eraseFromParent() to remove the need for SmallSetVector now in 66bc4579b9a07ae0998b618e13593d622fea00cd
https://github.com/llvm/llvm-project/pull/180898
More information about the llvm-commits
mailing list