[llvm] db412aa - [Mips] Convert index to pointer type in lowerMSACopyIntr. (#228332)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 01:19:13 PDT 2026


Author: Craig Topper
Date: 2026-10-02T08:18:55Z
New Revision: db412aa8e5c7e056a106a3c414cb0b55d1868c40

URL: https://github.com/llvm/llvm-project/commit/db412aa8e5c7e056a106a3c414cb0b55d1868c40
DIFF: https://github.com/llvm/llvm-project/commit/db412aa8e5c7e056a106a3c414cb0b55d1868c40.diff

LOG: [Mips] Convert index to pointer type in lowerMSACopyIntr. (#228332)

The MipsISD::VEXTRACT_[SZ]EXT_ELT nodes expect a pointer sized index.

Found while trying to implement SDTCisPtrTy checking in verifySDNode.

Added: 
    

Modified: 
    llvm/lib/Target/Mips/MipsSEISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
index 2d17cab760ac4..f9af7bd6c4034 100644
--- a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
@@ -1559,7 +1559,9 @@ static SDValue lowerDSPIntr(SDValue Op, SelectionDAG &DAG, unsigned Opc) {
 static SDValue lowerMSACopyIntr(SDValue Op, SelectionDAG &DAG, unsigned Opc) {
   SDLoc DL(Op);
   SDValue Vec = Op->getOperand(1);
-  SDValue Idx = Op->getOperand(2);
+  const TargetLowering &TLI = DAG.getTargetLoweringInfo();
+  SDValue Idx = DAG.getZExtOrTrunc(Op->getOperand(2), DL,
+                                   TLI.getVectorIdxTy(DAG.getDataLayout()));
   EVT ResTy = Op->getValueType(0);
   EVT EltTy = Vec->getValueType(0).getVectorElementType();
 


        


More information about the llvm-commits mailing list