This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes][VP] Add integer promotion support for VP_SIGN_EXTEND and VP_ZERO_EXTEND
Needs ReviewPublic

Authored by Jimerlife on May 13 2022, 1:33 AM.

Details

Summary

Add integer promotion support for VP_SIGN_EXTEND and VP_ZERO_EXTEND like sign_extend and zero_extend

Diff Detail

Event Timeline

Jimerlife created this revision.May 13 2022, 1:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 1:33 AM
Jimerlife requested review of this revision.May 13 2022, 1:33 AM
Jimerlife updated this revision to Diff 429596.May 15 2022, 7:27 PM
Jimerlife updated this revision to Diff 429966.May 17 2022, 2:06 AM
Jimerlife updated this revision to Diff 429969.May 17 2022, 2:15 AM
Jimerlife updated this revision to Diff 429976.May 17 2022, 2:38 AM
craig.topper added inline comments.May 17 2022, 10:49 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
747

This assert isn't useful, it's repeating the if condition.

751

This handling is quite different than what was done for the none-VP version. Are we only doing this so getNode will squash the de-generate SIGN_EXTEND/ZERO_EXTEND that we get when NVT == Res.getValueType()?

1972

No need for else if the if returned

1975

Using SExtPromotedInteger creates a SIGN_EXTEND_INREG node. But that doesn't preserve the mask and VL. Should we have VP_SIGN_EXTEND_INREG? @frasercrmck @simoll

2120

No need for else if the if returned

2123

ZExtPromotedInteger uses ISD::AND, should we have a VP_AND here?