Skip to content

Conversation

@davemgreen
Copy link
Collaborator

When dealing with smaller-than-legal vectors (like v3i8) there are two ways to legalizer the type to a larger vector. Non-power-2 vector types are always widened to a power-2 vector size (adding more elements to the end, so to v4i8). From there we have the option to promote to v4i16 or widen to v8i8. In SDAG we would promote integer types and widen fp vectors, which dictates how the argument types are legalized.

In GISel we have the option to pick, but vector operations like shuffle and extract/insert need to opt for one (they can't pick differently at the moment between int and fp). Promote can mean more extends and truncates, although both have advantages and disadvantages.

This patch switches some of the basic integer vector operations (add, sub, mul, and, or, xor) to widen as opposed to promote, which is hopefully a better method going forward and matches more other operations. Some of the legalization still isn't the best, especially where the result is forced to an argument or return type (which comes up more in tests than in real-life), and some will need extra post-legalization combines to improve.

When dealing with smaller-than-legal vectors (like v3i8) there are two ways to
legalizer the type to a larger vector. Non-power-2 vector types are always
widened to a power-2 vector size (adding more elements to the end, so to v4i8).
From there we have the option to promote to v4i16 or widen to v8i8. In SDAG we
would promote integer types and widen fp vectors, which dictates how the
argument types are legalized.

In GISel we have the option to pick, but vector operations like shuffle and
extract/insert need to opt for one (they can't pick differently at the moment
between int and fp). Promote can mean more extends and truncates, although both
have advantages and disadvantages.

This patch switches some of the basic integer vector operations (add, sub, mul,
and, or, xor) to widen as opposed to promote, which is hopefully a better
method going forward and matches more other operations. Some of the
legalization still isn't the best, especially where the result is forced to an
argument or return type (which comes up more in tests than in real-life), and
some will need extra post-legalization combines to improve.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant