This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes] Remove IsVP argument from type legalization methods. NFC
ClosedPublic

Authored by craig.topper on Jan 3 2022, 11:54 PM.

Details

Summary

We can either check the opcode or number of operands or use
ISD::isVPOpcode inside the methods.

In some places I've used number of operands figuring that it is
cheaper than isVPOpcode. I've included isVPOpcode in an assert to
verify.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 3 2022, 11:54 PM
craig.topper requested review of this revision.Jan 3 2022, 11:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 3 2022, 11:54 PM
frasercrmck accepted this revision.Jan 4 2022, 4:37 AM

LGTM. I originally went for IsVP as it's arguably clearer to the reader, but I suppose it is better to avoid relying on extra params when the info is already known via other means. The isVPOpcode assertions help make sense of it.

This revision is now accepted and ready to land.Jan 4 2022, 4:37 AM

Add SDNode::isVPOpcode. Group VP opcodes with their not VP opcodes in some of the switches.

craig.topper requested review of this revision.Jan 4 2022, 10:05 AM

@frasercrmck mind checking this again with the new changes.

craig.topper edited the summary of this revision. (Show Details)Jan 4 2022, 10:05 AM
frasercrmck accepted this revision.Jan 5 2022, 2:52 AM

Still looks good to me. I am in two minds about the switch formatting; on one hand it's not clang-tidied, but on the other (two) hand(s)m the equality is clearer, and the formatting's already unconventional in these files. So I think I lean towards it being fine as you've got it. Cheers.

This revision is now accepted and ready to land.Jan 5 2022, 2:52 AM
This revision was landed with ongoing or failed builds.Jan 5 2022, 9:01 AM
This revision was automatically updated to reflect the committed changes.