This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support isel of scalable vector bitcasts
ClosedPublic

Authored by craig.topper on Feb 17 2021, 5:09 PM.

Details

Summary

These should be NOPs so we can just replace with the input. This
matches what SVE does with isel patterns for all permutations.
Custom isel saves us from having to list all permurations for
all LMULs.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 17 2021, 5:09 PM
craig.topper requested review of this revision.Feb 17 2021, 5:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2021, 5:09 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
frasercrmck added inline comments.Feb 18 2021, 1:21 AM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
752

I'm kind of surprised this works - doesn't ReplaceUses expect the "from" and "to" to have the same type?

craig.topper added inline comments.Feb 18 2021, 8:40 AM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
752

It doesn't check. Here is what tablegen generates for AArch64

/*278776*/    OPC_CompleteMatch, 1, 0,-                                                                                                                                                                                                                                                                                             
               // Src: (bitconvert:{ *:[nxv2f64] } ZPR:{ *:[nxv8bf16] }:$src) - Complexity = 3                                                                                                                                                                                                                                      
               // Dst: ZPR:{ *:[nxv2f64] }:$src

CompleteMatch calls ReplaceUses, there's an assert above the call to ReplaceUses in CompleteMatch that checks if the VT matches OR that the type has the same number of bits.

frasercrmck accepted this revision.Feb 18 2021, 8:42 AM

LGTM.

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
752

Thanks: that's the bit I was missing; the fact that at that stage it's no longer purely value-type-focused.

This revision is now accepted and ready to land.Feb 18 2021, 8:42 AM
This revision was automatically updated to reflect the committed changes.