@@ -25243,7 +25243,8 @@ static SDValue narrowExtractedVectorBinOp(SDNode *Extract, SelectionDAG &DAG,
25243
25243
/// If we are extracting a subvector from a wide vector load, convert to a
25244
25244
/// narrow load to eliminate the extraction:
25245
25245
/// (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) {
25247
25248
// TODO: Add support for big-endian. The offset calculation must be adjusted.
25248
25249
if (DAG.getDataLayout().isBigEndian())
25249
25250
return SDValue();
@@ -25283,8 +25284,6 @@ static SDValue narrowExtractedVectorLoad(SDNode *Extract, SelectionDAG &DAG) {
25283
25284
25284
25285
// The narrow load will be offset from the base address of the old load if
25285
25286
// we are extracting from something besides index 0 (little-endian).
25286
- SDLoc DL(Extract);
25287
-
25288
25287
// TODO: Use "BaseIndexOffset" to make this more effective.
25289
25288
SDValue NewAddr = DAG.getMemBasePlusOffset(Ld->getBasePtr(), Offset, DL);
25290
25289
@@ -25468,7 +25467,7 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
25468
25467
return DAG.getUNDEF(NVT);
25469
25468
25470
25469
if (TLI.isOperationLegalOrCustomOrPromote(ISD::LOAD, NVT))
25471
- if (SDValue NarrowLoad = narrowExtractedVectorLoad(N, DAG))
25470
+ if (SDValue NarrowLoad = narrowExtractedVectorLoad(N, DL, DAG))
25472
25471
return NarrowLoad;
25473
25472
25474
25473
// Combine an extract of an extract into a single extract_subvector.
0 commit comments