Page MenuHomePhabricator

GlobalISel: Try to make legalize rules more useful for vectors
ClosedPublic

Authored by arsenm on Jan 19 2019, 6:25 PM.

Details

Summary

Mostly keep the existing functions on scalars, but add versions which
also operate based on the vector element size.

Diff Detail

Event Timeline

arsenm created this revision.Jan 19 2019, 6:25 PM

My preference here would be to have a separate set of mutations for vector elements, @dsanders @aditya_nandakumar what do you think?

My preference here would be to have a separate set of mutations for vector elements, @dsanders @aditya_nandakumar what do you think?

What about having 3 versions for each of these? e.g. minScalar, minElement, minScalarOrElement?

My preference here would be to have a separate set of mutations for vector elements, @dsanders @aditya_nandakumar what do you think?

What about having 3 versions for each of these? e.g. minScalar, minElement, minScalarOrElement?

I don't think we need separate mutations to do the same thing. I would prefer using widenScalarToNextPow2, but we should rename it to make it clear. Maybe something like widenScalarOrElementToNextPow2?

@aemerson @arsenm, what do you think?

My preference here would be to have a separate set of mutations for vector elements, @dsanders @aditya_nandakumar what do you think?

What about having 3 versions for each of these? e.g. minScalar, minElement, minScalarOrElement?

I don't think we need separate mutations to do the same thing. I would prefer using widenScalarToNextPow2, but we should rename it to make it clear. Maybe something like widenScalarOrElementToNextPow2?

@aemerson @arsenm, what do you think?

That's ok with me, maybe shorten it a bit to widenScalarOrEltToNextPow2.

aemerson accepted this revision.Feb 1 2019, 3:51 PM

LGTM with a renaming.

This revision is now accepted and ready to land.Feb 1 2019, 3:51 PM
arsenm added a comment.Feb 1 2019, 4:34 PM

My preference here would be to have a separate set of mutations for vector elements, @dsanders @aditya_nandakumar what do you think?

What about having 3 versions for each of these? e.g. minScalar, minElement, minScalarOrElement?

I don't think we need separate mutations to do the same thing. I would prefer using widenScalarToNextPow2, but we should rename it to make it clear. Maybe something like widenScalarOrElementToNextPow2?

@aemerson @arsenm, what do you think?

I still think having scalar and scalarOrElt versions of the various LegalizeRuleSet functions would be useful. I think there are legitimate uses for clamping the vector and scalar element sizes separately, and wanting both to match would also be common. Also if I just change the behavior of all of these now, I'm going to have to update all of the targets with new, untested legalization behavior for all of the vector types. I'll try to produce the full set of these and see what it looks like.

arsenm updated this revision to Diff 184887.Feb 1 2019, 8:14 PM
arsenm retitled this revision from GlobalISel: Fix widenScalarToNextPow2 mutation for vectors to GlobalISel: Try to make legalize rules more useful for vectors.
arsenm edited the summary of this revision. (Show Details)
arsenm requested review of this revision.Feb 4 2019, 6:13 AM
aemerson accepted this revision.Feb 6 2019, 2:27 PM

Thanks, LGTM.

This revision is now accepted and ready to land.Feb 6 2019, 2:27 PM
arsenm closed this revision.Feb 7 2019, 9:25 AM

r353430