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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 12:15:14 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)));
----------------
topperc wrote:

If the type isn't legal SDAG will use the type legalizer to legalize the type. That's standard behavior for any operation. I don't know what it does for a scalable vector that isn't legal.

GlobalISel cannot let an unsupported type move forward to register bank selection.

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


More information about the llvm-commits mailing list