[llvm] [VPlan] Introduce explicit broadcasts for live-ins. (PR #124644)
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 6 01:46:51 PST 2025
================
@@ -2154,3 +2154,34 @@ void VPlanTransforms::handleUncountableEarlyExit(
Builder.createNaryOp(VPInstruction::BranchOnCond, AnyExitTaken);
LatchExitingBranch->eraseFromParent();
}
+
+void VPlanTransforms::materializeBroadcasts(VPlan &Plan) {
+ VPDominatorTree VPDT;
+ VPDT.recalculate(Plan);
+ auto *VectorPreheader = Plan.getVectorPreheader();
+ VPBuilder Builder(VectorPreheader);
+ for (VPValue *LiveIn : Plan.getLiveIns()) {
+ if (all_of(LiveIn->users(),
+ [LiveIn](VPUser *U) {
+ return cast<VPRecipeBase>(U)->usesScalars(LiveIn);
+ }) ||
----------------
Mel-Chen wrote:
I saw that this patch adds many implementations of `onlyFirstLaneUsed`. Is this for the correctness of `useScalars` here?
https://github.com/llvm/llvm-project/pull/124644
More information about the llvm-commits
mailing list