[PATCH] D79100: [LV][TTI] Emit new IR intrinsic llvm.get.active.mask

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 14:06:17 PDT 2020


rogfer01 added a comment.

> Tail-predication is a new form of predication in MVE for vector loops that implicitely predicates the last vector loop iteration by implicitely setting active/inactive lanes, i.e. the tail loop is predicated. In order to set up a tail-predicated vector loop, we need to know the number of data elements processed by the vector loop, which corresponds the the tripcount of the scalar loop. We would like to propagate the scalar trip count to the backend, so that this can be picked up by the MVE tail-predication pass.

Just to make sure I understand: is this text still current? Your intrinsic does not seem to propagate the scalar trip count anymore (at least not explicitly). If I understand it correctly, now you communicate the active mask of the current vector iteration which you compute using `i <= backedge taken-count`. Did I get it right?



================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:386
+    Value *TC = State.get(getOperand(1), Part);
+    Value *V = Builder.CreateICmpULE(IV, TC);
+
----------------
Minor nit:

Here you use `TC` (as in trip count?) but above when you created this `VPInstruction` you used `BTC` (backedge taken count).

This might be confusing for a future reader so I'd suggest to stick to your own convention and use `BTC` here as well.

This code seems similar to that of `VPRecipeBuilder::createBlockInMask` (except that one creates the mask for a given block and this one creates a mask similar to the case `OrigLoop->getHeader() == BB`). That function uses `BTC` as well.


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

https://reviews.llvm.org/D79100





More information about the llvm-commits mailing list