This is an archive of the discontinued LLVM Phabricator instance.

[Matrix] Add asserts for mismatched element types.
ClosedPublic

Authored by braedy on Jul 22 2020, 5:17 PM.

Details

Summary

This patch clarifies the failing point of having input or output vectors
of differing types. Before, lowering would fail elsewhere (e.g. in
fmul creation) which may have been not immediately clear.

As a side effect, the getElementType and getVectoryTy functions
required the const qualifier to be added.

Diff Detail

Event Timeline

braedy created this revision.Jul 22 2020, 5:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2020, 5:17 PM
fhahn accepted this revision.Jul 23 2020, 2:10 AM
fhahn added a subscriber: SjoerdMeijer.

LGTM, thanks!

I *think* thanks to @SjoerdMeijer 's recent improvements to the IR verifier, some of those cases should be caught directly by the verifier. But those assertions are helpful in any case, to explicitly state the assumption in the code.

This revision is now accepted and ready to land.Jul 23 2020, 2:10 AM

Yep, think so too that this should be caught by the Verifier, but like you said, doesn't hurt to have them here too.

braedy added a comment.EditedJul 23 2020, 7:11 AM

I was unaware of these changes to the verifier but like you've said, it's still reasonable. The side effect of adding the const qualifier is also useful to me in a future patch.

@fhahn Can you push this?

fhahn added a comment.Jul 23 2020, 7:15 AM

I was unaware of these changes to the verifier but like you've, it's still reasonable. The side effect of adding the const qualifier is also useful to me in a future patch.

@fhahn Can you push this?

Sure, could let me know the name & email I should use to set the author of the commit?

Braedy Kuzma
braedy@ualberta.ca

This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Jul 23 2020, 8:03 AM

Great, thanks!