This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes][VP] Add widen and split support for VP_TRUNCATE
ClosedPublic

Authored by Jimerlife on May 19 2022, 12:16 AM.

Details

Diff Detail

Event Timeline

Jimerlife created this revision.May 19 2022, 12:16 AM
Jimerlife requested review of this revision.May 19 2022, 12:16 AM
frasercrmck added inline comments.May 19 2022, 12:25 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
3420

I don't follow this comment, I'm afraid. Is it saying that other targets may need special target-specific handling in SplitVeOp_UnaryOp for VP_TRUNCATE? I'd prefer to avoid mentioning targets in SelectionDAG if it can be helped - this is meant to be target-agnostic code.

4249

Maybe an assert like ISD::isVPOpcode? here?

rebase and address comment

Jimerlife added inline comments.May 20 2022, 12:05 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
3420

What I meant is now only implement SplitVeOp_UnaryOp for VP_TRUNCATE. In this SplitVecOp_TruncateHelper method , I cann't write a RISCV test trigger the code from line 3425 to end, so I do nothing in this part of code.Maybe other Targets should do special handle VP_TRUNCATE in this part of code.
Angway, I remove this comment, Thank you.

4249

You right. Add an assert to confirm it's VPOpcode.

craig.topper added inline comments.May 24 2022, 12:29 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
2912

Check the operand count instead of the opcode? Then assert isVPOpcode like the widening code.

Jimerlife updated this revision to Diff 431863.May 24 2022, 7:34 PM

rebase and address comment

Jimerlife added inline comments.May 24 2022, 7:38 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
2912

I agree with you. Then there is more general.

This revision is now accepted and ready to land.May 25 2022, 10:05 AM
This revision was landed with ongoing or failed builds.May 25 2022, 7:03 PM
This revision was automatically updated to reflect the committed changes.