[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
Fri Jun 10 00:51:15 PDT 2022


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:1568
+        createStepForVF(State.Builder, TC->getType(), State.VF, Part);
+    Instruction *StartMask = State.Builder.CreateIntrinsic(
+        Intrinsic::get_active_lane_mask, {PredTy, TC->getType()}, {StartIV, TC},
----------------
fhahn wrote:
> The start value should be created in the preheader block in VPlan instead of in the phi node here. There there should also be no need for a TC argument?
Hi @fhahn, I'm not really sure what you mean here. Do you mean that LoopVectorize.cpp should create a VPInstruction with type ActiveLaneMask that lives in the VPlan's preheader block? If so, then VPInstruction::ActiveLaneMask needs a trip count operand.

Or do you mean I should deviate from the expected recipe creation somehow in a VPlan function such as prepareToExecute by manually adding the incoming value?


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

https://reviews.llvm.org/D125301



More information about the llvm-commits mailing list