[PATCH] D142015: [LV] Plan with and without FoldTailByMasking

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 15:09:36 PST 2023


fhahn requested changes to this revision.
fhahn added a comment.
This revision now requires changes to proceed.

I think the overall direction is very desirable! However I am not sure if adding a FoldTail argument to the cost functions is an ideal way to get there as it requires a large number of changes and is not really scalable (e.g. adding support to generate a 3rd variant of plans may mean adding another argument to all functions)

I am not sure if I am missing something, but would it be possible to instead run the planner multiple times with different cost-model configurations? I tried to sketch an option for more general support for that in D142669 <https://reviews.llvm.org/D142669>. Then we could generate the plans for tail-folding by just instantiating another instance of the cost model, sketched in D142670 <https://reviews.llvm.org/D142670>. Maybe that could help to simplify the patch?

Another thing I noticed that the patch changes skeleton creation to take a VPlan as argument. I think it would be preferable to do this the other way around if possible, so instead model the difference between plans with and without tail-folding explicitly in the pre-header blocks in the VPlan. I've not looked at the details here to see how difficult that would be yet unfortunately though. But more than happy to iterate on that aspect together!


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

https://reviews.llvm.org/D142015



More information about the llvm-commits mailing list