[llvm] [RISCV][GISEL] Legalize G_VSCALE (PR #85967)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 06:37:19 PDT 2024


================
@@ -1699,6 +1699,21 @@ LegalizerHelper::LegalizeResult LegalizerHelper::narrowScalar(MachineInstr &MI,
   case TargetOpcode::G_FLDEXP:
   case TargetOpcode::G_STRICT_FLDEXP:
     return narrowScalarFLDEXP(MI, TypeIdx, NarrowTy);
+  case TargetOpcode::G_VSCALE: {
+    Register Dst = MI.getOperand(0).getReg();
+    LLT Ty = MRI.getType(Dst);
+    LLT HalfTy = Ty.divide(2);
+
+    // Assume VSCALE(1) fits into a legal integer
+    const APInt One(HalfTy.getSizeInBits(), 1);
----------------
michaelmaitland wrote:

updated

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


More information about the llvm-commits mailing list