This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Implement fewerElementsVector for constants
AbandonedPublic

Authored by arsenm on Jan 7 2019, 1:29 AM.

Diff Detail

Event Timeline

arsenm created this revision.Jan 7 2019, 1:29 AM

This is strange. G_CONSTANT isn't supposed to be able to splat the constant into a vector, so this is an oversight in the MachineVerifier for not catching this case.

Constant vectors are handled in the IRTranslator as G_BUILD_VECTORs of the constant element values. Sorry about the confusion.

volkan added a subscriber: volkan.Jan 7 2019, 1:45 PM

This is strange. G_CONSTANT isn't supposed to be able to splat the constant into a vector, so this is an oversight in the MachineVerifier for not catching this case.

Constant vectors are handled in the IRTranslator as G_BUILD_VECTORs of the constant element values. Sorry about the confusion.

They aren't handled this way in the MachineIRBuilder. I would prefer it if G_CONSTANT did splat, since I always found this extremely annoying in SelectionDAG

This is strange. G_CONSTANT isn't supposed to be able to splat the constant into a vector, so this is an oversight in the MachineVerifier for not catching this case.

Constant vectors are handled in the IRTranslator as G_BUILD_VECTORs of the constant element values. Sorry about the confusion.

They aren't handled this way in the MachineIRBuilder. I would prefer it if G_CONSTANT did splat, since I always found this extremely annoying in SelectionDAG

It would be clear if we want constant vectors, that the destination and source be vector types - so that would mean we have ConstantVector for the RHS. I'm not sure how this would look in MIR.
I agree with you though - it is annoying to do a build_vector for constant vectors. Maybe instead of implicit splat, if we could have a G_CONSTANT_VECTOR depending on how badly we want to avoid the build_vector.

See also D56307

Sorry about this - I think this patch would make it inconsistent with how we handle constant vectors now (for eg IRTranslator).

This should be abandoned?

arsenm abandoned this revision.Jan 22 2019, 1:30 PM