This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes][VP] Add widening support for vp.select
ClosedPublic

Authored by victor-eds on Dec 30 2021, 5:17 AM.

Details

Summary

Widen vp.select the same way as select and vselect.

Diff Detail

Event Timeline

victor-eds created this revision.Dec 30 2021, 5:17 AM
victor-eds requested review of this revision.Dec 30 2021, 5:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 30 2021, 5:17 AM

Apply format changes

I think the legalization itself is sound: just nits.

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
4528

Similar comment to D116400 really - rename this function? Though arguably a precedent has already been set here since SELECT and VSELECT were both already using this function. So I'm not sure.

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vselect-vp.ll
7

Maybe move this in between <4 x i8> and <8 x i8>? That way there's a progression of vector widths.

llvm/test/CodeGen/RISCV/rvv/vselect-vp.ll
7

Maybe move this in between <vscale x 8 x i8> and <vscale x 16 x i8>?

victor-eds updated this revision to Diff 397040.Jan 3 2022, 4:09 AM

Move new tests

victor-eds marked 2 inline comments as done.Jan 3 2022, 4:14 AM
craig.topper added inline comments.Jan 3 2022, 10:24 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
4566–4569

Check the opcode and avoid the bool and merge the switch cases.

victor-eds updated this revision to Diff 397224.Jan 4 2022, 1:07 AM

Drop boolean argument and rename function

victor-eds marked 2 inline comments as done.Jan 4 2022, 1:09 AM

Done

craig.topper accepted this revision.Jan 4 2022, 9:52 PM

LGTM with that one comment

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