@@ -25243,7 +25243,8 @@ static SDValue narrowExtractedVectorBinOp(SDNode *Extract, SelectionDAG &DAG,
2524325243/// If we are extracting a subvector from a wide vector load, convert to a
2524425244/// narrow load to eliminate the extraction:
2524525245/// (extract_subvector (load wide vector)) --> (load narrow vector)
25246- static SDValue narrowExtractedVectorLoad(SDNode *Extract, SelectionDAG &DAG) {
25246+ static SDValue narrowExtractedVectorLoad(SDNode *Extract, const SDLoc &DL,
25247+ SelectionDAG &DAG) {
2524725248 // TODO: Add support for big-endian. The offset calculation must be adjusted.
2524825249 if (DAG.getDataLayout().isBigEndian())
2524925250 return SDValue();
@@ -25283,8 +25284,6 @@ static SDValue narrowExtractedVectorLoad(SDNode *Extract, SelectionDAG &DAG) {
2528325284
2528425285 // The narrow load will be offset from the base address of the old load if
2528525286 // we are extracting from something besides index 0 (little-endian).
25286- SDLoc DL(Extract);
25287-
2528825287 // TODO: Use "BaseIndexOffset" to make this more effective.
2528925288 SDValue NewAddr = DAG.getMemBasePlusOffset(Ld->getBasePtr(), Offset, DL);
2529025289
@@ -25468,7 +25467,7 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
2546825467 return DAG.getUNDEF(NVT);
2546925468
2547025469 if (TLI.isOperationLegalOrCustomOrPromote(ISD::LOAD, NVT))
25471- if (SDValue NarrowLoad = narrowExtractedVectorLoad(N, DAG))
25470+ if (SDValue NarrowLoad = narrowExtractedVectorLoad(N, DL, DAG))
2547225471 return NarrowLoad;
2547325472
2547425473 // Combine an extract of an extract into a single extract_subvector.
0 commit comments