[llvm] [AArch64] Fix assertion failure during promotion of EXTEND_VECTOR_INREG. (PR #171619)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 10 08:52:23 PST 2025


================
@@ -6206,6 +6206,15 @@ SDValue DAGTypeLegalizer::PromoteIntRes_EXTEND_VECTOR_INREG(SDNode *N) {
       default:
         llvm_unreachable("Node has unexpected Opcode");
     }
+    if (Promoted.getValueType().getSizeInBits() > NVT.getSizeInBits()) {
+      unsigned NewSize = NVT.getSizeInBits();
+      EVT ExtractVT = EVT::getVectorVT(
+          *DAG.getContext(), Promoted.getValueType().getScalarType(),
+          NewSize / Promoted.getScalarValueSizeInBits());
+
+      Promoted = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, ExtractVT, Promoted,
----------------
arsenm wrote:

```suggestion
      Promoted = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, NVT, Promoted,
```

Don't think you need to reconstruct the type to use? 

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


More information about the llvm-commits mailing list