This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Simplify PromoteIntRes_INSERT_SUBVECTOR to only handle result
ClosedPublic

Authored by bsmith on Jul 8 2021, 5:32 AM.

Details

Summary

Let other parts of legalization handle the rest of the node, this allows
re-use of existing optimizations elsewhere.

Diff Detail

Event Timeline

bsmith created this revision.Jul 8 2021, 5:32 AM
bsmith requested review of this revision.Jul 8 2021, 5:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2021, 5:32 AM
Matt added a subscriber: Matt.Jul 8 2021, 5:43 AM
craig.topper added inline comments.
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
4745

I'm not sure we should use changeVectorElementType here. If SubVecVT is an MVT, changeVectorElementType will only work if NSubVT can also be represented as an MVT. I don't think that's guaranteed so EVT::getVectorVT(NOutV.getVectorElementType(), SubVecVT.getVectorElementCount()) would be better.

4749–4750

This can be Vec = GetPromotedInteger(Vec) to get the already legalized value for that operand.

bsmith updated this revision to Diff 357253.Jul 8 2021, 9:25 AM
bsmith marked 2 inline comments as done.
  • Use GetPromotedInteger instead of manually extending
  • Construct new EVT to avoid issues with EVT vs MVT.

The code change looks good to me, but I don't know enough to review the test changes.

This revision is now accepted and ready to land.Jul 8 2021, 11:43 AM