@@ -1211,16 +1211,14 @@ bool NVPTXDAGToDAGISel::tryLoadVector(SDNode *N) {
12111211 // type is integer
12121212 // Float : ISD::NON_EXTLOAD or ISD::EXTLOAD and the type is float
12131213 // Read at least 8 bits (predicates are stored as 8-bit values)
1214- // The last operand holds the original LoadSDNode::getExtensionType() value
1215- const unsigned ExtensionType =
1216- N->getConstantOperandVal (N->getNumOperands () - 1 );
1214+ // Get the original LoadSDNode::getExtensionType() value
1215+ const unsigned ExtensionType = N->getConstantOperandVal (4 );
12171216 const unsigned FromType = (ExtensionType == ISD::SEXTLOAD)
12181217 ? NVPTX::PTXLdStInstCode::Signed
12191218 : NVPTX::PTXLdStInstCode::Untyped;
12201219
12211220 const unsigned FromTypeWidth = getFromTypeWidthForLoad (LD);
1222- const uint32_t UsedBytesMask =
1223- N->getConstantOperandVal (N->getNumOperands () - 2 );
1221+ const uint32_t UsedBytesMask = N->getConstantOperandVal (3 );
12241222
12251223 assert (!(EltVT.isVector () && ExtensionType != ISD::NON_EXTLOAD));
12261224
@@ -1273,8 +1271,8 @@ bool NVPTXDAGToDAGISel::tryLDG(MemSDNode *LD) {
12731271 ExtensionType = Load->getExtensionType ();
12741272 UsedBytesMask = UINT32_MAX;
12751273 } else {
1276- ExtensionType = LD->getConstantOperandVal (LD-> getNumOperands () - 1 );
1277- UsedBytesMask = LD->getConstantOperandVal (LD-> getNumOperands () - 2 );
1274+ ExtensionType = LD->getConstantOperandVal (4 );
1275+ UsedBytesMask = LD->getConstantOperandVal (3 );
12781276 }
12791277 const unsigned FromType = (ExtensionType == ISD::SEXTLOAD)
12801278 ? NVPTX::PTXLdStInstCode::Signed
0 commit comments