[PATCH] D96921: [RISCV] Support isel of scalable vector bitcasts

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 08:42:46 PST 2021


frasercrmck accepted this revision.
frasercrmck added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:763
+        Node->getOperand(0).getSimpleValueType().isScalableVector()) {
+      ReplaceUses(SDValue(Node, 0), Node->getOperand(0));
+      CurDAG->RemoveDeadNode(Node);
----------------
craig.topper wrote:
> frasercrmck wrote:
> > I'm kind of surprised this works - doesn't `ReplaceUses` expect the "from" and "to" to have the same type?
> 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.
Thanks: that's the bit I was missing; the fact that at that stage it's no longer purely value-type-focused. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96921/new/

https://reviews.llvm.org/D96921



More information about the llvm-commits mailing list