[llvm] [GlobalISel] Drop redundant scalable-dest check in G_EXTRACT_SUBVECTOR lowering (NFC) (PR #221934)
Szymon Piotr Milczek via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 02:23:10 PDT 2026
https://github.com/smilczek created https://github.com/llvm/llvm-project/pull/221934
The scalarizing lowering of G_EXTRACT_SUBVECTOR bails out for both a
scalable source and a scalable destination.
According to llvm/docs/GlobalISel/GenericOpcode.md, G_EXTRACT_SUBVECTOR
only supports extracting a fixed vector from a scalable vector, never a
scalable vector from a fixed one.
This means that a fixed source implies a fixed destination, making the
DstTy.isScalable() check redundant.
Remove it. NFC.
>From b505dcb4fd256acd8857d14fdae579c029d3c377 Mon Sep 17 00:00:00 2001
From: "Milczek, Szymon" <szymon.milczek at intel.com>
Date: Tue, 8 Sep 2026 11:11:24 +0200
Subject: [PATCH] [GlobalISel] Drop redundant scalable-dest check in
G_EXTRACT_SUBVECTOR lowering (NFC)
The scalarizing lowering of G_EXTRACT_SUBVECTOR bails out for both a
scalable source and a scalable destination.
According to llvm/docs/GlobalISel/GenericOpcode.md, G_EXTRACT_SUBVECTOR
only supports extracting a fixed vector from a scalable vector, never a
scalable vector from a fixed one.
This means that a fixed source implies a fixed destination, making the
DstTy.isScalable() check redundant.
Remove it. NFC.
---
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index b73d363f22665..0257119da0a6e 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -5008,7 +5008,7 @@ LegalizerHelper::lower(MachineInstr &MI, unsigned TypeIdx, LLT LowerHintTy) {
LLT SrcTy = MRI.getType(SrcReg);
LLT DstTy = MRI.getType(DstReg);
- if (SrcTy.isScalable() || DstTy.isScalable())
+ if (SrcTy.isScalable())
return UnableToLegalize;
if (SrcTy.getScalarType() != DstTy.getScalarType())
More information about the llvm-commits
mailing list