[PATCH] D102437: [LV] NFC: Decouple foldTailByMasking from isScalarWithPredication.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 03:46:21 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp:1343
+
+bool LoopVectorizationLegality::requiresPredicatedWidening(
+    Instruction *I, bool VFIterationIsPredicated) const {
----------------
sdesmalen wrote:
> SjoerdMeijer wrote:
> > I think this is related to the legal vs. cost-model discussion. I agree that it is probably more a cost-model thing. Does that mean this needs to live in CostModel, where it used to live?
> Okay, if you feel the same way, I'll just move it to the CostModel!
Just to clarify the original reason to move it to Legality was for a similar reason as that there exists `LoopVectoriztionLegality::blockNeedsPredication`, which describes a property of the original loop when vectorizing. The same property could be queried for a specific instruction, as if the interface was named `instructionNeedsPredication` (instead I named it requiresPredicatedWidening).

Also, by moving it out of the CostModel, we avoid private cost-model info to pollute the code such as the `foldTailByMasking()`, which this patch tries to split out)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102437



More information about the llvm-commits mailing list