Between line 6162 and 6263, you can add something like
auto MinVF = TTI.getMinimumVF(SmallestType); if (MinVF > MaxVF) MaxVF = MinVF;
Assuming that your load/store HW can be fooled between different data types of the same size (and I think most if not all are),
we really don't need to send in the actual data type. Just need the element data size. That'll minimize the change w/o losing generality.
I think the rest of the job can be (and should be) handled by your Target CG.
By refinement, I meant making it TTI based, keep it disabled by default, and enable it only for your target. Hopefully, that's easy enough for the rest of the community to quickly review/accept and has much lower chances to get reverted.
That alone I think addresses your immediate concerns, and then MinVF adjustment will add additional peace of mind for those targets that need such enforcement.
|1344 ↗||(On Diff #139286)|
Looks like a lot of the methods in here were added by Chandler in one commit without the const. It looks like quite a few at end were added later with const. I didn't scroll down enough before to see them before. const seems more correct. So I guess leave it.