[llvm] 497ea1d - [DAG] tryToFoldExtendSelectLoad - reuse existing SDLoc. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 18 08:19:30 PDT 2024
Author: Simon Pilgrim
Date: 2024-07-18T16:19:15+01:00
New Revision: 497ea1d84951626dea5bf644fef2d99e145e21ac
URL: https://github.com/llvm/llvm-project/commit/497ea1d84951626dea5bf644fef2d99e145e21ac
DIFF: https://github.com/llvm/llvm-project/commit/497ea1d84951626dea5bf644fef2d99e145e21ac.diff
LOG: [DAG] tryToFoldExtendSelectLoad - reuse existing SDLoc. NFC.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 30203f9119af7..9b2153c68ccae 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -12812,13 +12812,11 @@ static bool isCompatibleLoad(SDValue N, unsigned ExtOpcode) {
/// This function is called by the DAGCombiner when visiting sext/zext/aext
/// dag nodes (see for example method DAGCombiner::visitSIGN_EXTEND).
static SDValue tryToFoldExtendSelectLoad(SDNode *N, const TargetLowering &TLI,
- SelectionDAG &DAG,
+ SelectionDAG &DAG, const SDLoc &DL,
CombineLevel Level) {
unsigned Opcode = N->getOpcode();
SDValue N0 = N->getOperand(0);
EVT VT = N->getValueType(0);
- SDLoc DL(N);
-
assert((Opcode == ISD::SIGN_EXTEND || Opcode == ISD::ZERO_EXTEND ||
Opcode == ISD::ANY_EXTEND) &&
"Expected EXTEND dag node in input!");
@@ -13775,7 +13773,7 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
return DAG.getNode(ISD::ADD, DL, VT, Zext, DAG.getAllOnesConstant(DL, VT));
}
- if (SDValue Res = tryToFoldExtendSelectLoad(N, TLI, DAG, Level))
+ if (SDValue Res = tryToFoldExtendSelectLoad(N, TLI, DAG, DL, Level))
return Res;
return SDValue();
@@ -13860,8 +13858,7 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) {
// fold (zext (zext_extend_vector_inreg x)) -> (zext_extend_vector_inreg x)
if (N0.getOpcode() == ISD::ANY_EXTEND_VECTOR_INREG ||
N0.getOpcode() == ISD::ZERO_EXTEND_VECTOR_INREG)
- return DAG.getNode(ISD::ZERO_EXTEND_VECTOR_INREG, SDLoc(N), VT,
- N0.getOperand(0));
+ return DAG.getNode(ISD::ZERO_EXTEND_VECTOR_INREG, DL, VT, N0.getOperand(0));
// fold (zext (truncate x)) -> (zext x) or
// (zext (truncate x)) -> (truncate x)
@@ -14147,7 +14144,7 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) {
if (SDValue V = widenAbs(N, DAG))
return V;
- if (SDValue Res = tryToFoldExtendSelectLoad(N, TLI, DAG, Level))
+ if (SDValue Res = tryToFoldExtendSelectLoad(N, TLI, DAG, DL, Level))
return Res;
// CSE zext nneg with sext if the zext is not free.
@@ -14322,7 +14319,7 @@ SDValue DAGCombiner::visitANY_EXTEND(SDNode *N) {
if (SDValue NewCtPop = widenCtPop(N, DAG))
return NewCtPop;
- if (SDValue Res = tryToFoldExtendSelectLoad(N, TLI, DAG, Level))
+ if (SDValue Res = tryToFoldExtendSelectLoad(N, TLI, DAG, DL, Level))
return Res;
return SDValue();
More information about the llvm-commits
mailing list