[llvm] [RISCV][GISEL] Legalize G_EXTRACT_SUBVECTOR (PR #109426)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 30 10:41:45 PDT 2024
================
@@ -3666,6 +3666,63 @@ LegalizerHelper::bitcastConcatVector(MachineInstr &MI, unsigned TypeIdx,
return Legalized;
}
+/// This attempts to bitcast G_EXTRACT_SUBVECTOR to CastTy.
+///
+/// <vscale x 8 x i1> = G_EXTRACT_SUBVECTOR <vscale x 16 x i1>, N
+///
+/// ===>
+///
+/// <vscale x 2 x i1> = G_BITCAST <vscale x 16 x i1>
+/// <vscale x 1 x i8> = G_EXTRACT_SUBVECTOR <vscale x 2 x i1>, N / 8
+/// <vscale x 8 x i1> = G_BITCAST <vscale x 1 x i8>
+LegalizerHelper::LegalizeResult
+LegalizerHelper::bitcastExtractSubvector(MachineInstr &MI, unsigned TypeIdx,
+ LLT CastTy) {
+ auto ES = dyn_cast<GExtractSubvector>(&MI);
----------------
topperc wrote:
If its not possible to hit we should just use `cast`. If it is possible, then it should have a test. Otherwise it's an untested path.
https://github.com/llvm/llvm-project/pull/109426
More information about the llvm-commits
mailing list