This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Replace ISD::FP_EXTEND and ISD::FP_ROUND with RVV VL op.
ClosedPublic

Authored by jacquesguan on May 11 2022, 2:28 AM.

Details

Summary

This patch tries to solve the incoordination between the direct and intermediate cast caused by D123975.
This patch replaces ISD::FP_EXTEND and ISD::FP_ROUND with RVV VL op in the lowering of FP scalable vector direct cast to unify with the intermediate cast.
And it also changes the FP widenning pattern with the VL op.

Diff Detail

Event Timeline

jacquesguan created this revision.May 11 2022, 2:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2022, 2:28 AM
jacquesguan requested review of this revision.May 11 2022, 2:28 AM
frasercrmck added inline comments.May 20 2022, 6:23 AM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
822

Using V0 in VL patterns is uncommon. We do it twice but I'm not entirely sure why or if that's an oversight. Shouldn't we be using VLOpFrag and GPR:$vl?

Use VLOpFrag instead of X0.

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
822

Done, thanks.

craig.topper added inline comments.May 24 2022, 12:36 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
1524

Don't move things to this file that use none _vl ISD opcodes. This file should be pure VL patterns.

craig.topper added inline comments.May 24 2022, 12:40 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
827

This is taking the VL from the fpextend_vl node, but the root node of the pattern has no VL operand. Shouldn't we still be using vti.AVL?

move patterns back to RISCVInstrInfoVSDPatterns.td

jacquesguan added inline comments.May 24 2022, 8:07 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
827

That would cause error dead named input: $vl.

1524

Done, I move those patterns back to RISCVInstrInfoVSDPatterns.td.

craig.topper added inline comments.May 24 2022, 9:46 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
827

Yes it would, but's because we don't want that vl. I think you need to use (XLenVT srcvalue) instead of VLOpFrag.

frasercrmck added inline comments.May 24 2022, 9:49 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
827

Sorry about that, I think I mislead things. I got confused somewhat by these patterns previously being in the VL patterns file.

address comment.

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
827

Thanks, done.

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