Details
- Reviewers
dsanders aditya_nandakumar aemerson
Diff Detail
Event Timeline
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.
Sorry about this - I think this patch would make it inconsistent with how we handle constant vectors now (for eg IRTranslator).