[llvm] [RISCV][GISEL] Legalize G_BITCAST for scalable vectors (PR #85970)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 05:56:10 PDT 2024


================
@@ -155,6 +155,9 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
 
   getActionDefinitionsBuilder(G_BITREVERSE).maxScalar(0, sXLen).lower();
 
+  getActionDefinitionsBuilder(G_BITCAST).legalIf(
+      all(isScalableVector(0), isScalableVector(1)));
----------------
michaelmaitland wrote:

> It doesn't matter if you claim invalid type combinations are legal, they won't exist in the first place

> I would assume you need some maximum min elements supported here

Are these two statements conflicting? Maximum number of elements would probably come from the maximum number of elements of one of the legal RISC-V types.

https://github.com/llvm/llvm-project/pull/85970


More information about the llvm-commits mailing list