Skip to content

Commit 1dbfb70

Browse files
committed
address comment
1 parent 955e081 commit 1dbfb70

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9012,12 +9012,14 @@ static void checkAddrSpaceIsValidForLibcall(const TargetLowering *TLI,
90129012
}
90139013
}
90149014

9015-
static bool isTailCall(const CallInst *CI, const SelectionDAG *SelDAG,
9016-
bool IsLowerToLibCall) {
9017-
bool ReturnsFirstArg = CI && funcReturnsFirstArgOfCall(*CI);
9015+
static bool isInTailCallPositionWrapper(const CallInst *CI,
9016+
const SelectionDAG *SelDAG,
9017+
bool IsLowerToLibCall) {
9018+
90189019
return CI && CI->isTailCall() &&
90199020
isInTailCallPosition(*CI, SelDAG->getTarget(),
9020-
ReturnsFirstArg && IsLowerToLibCall);
9021+
funcReturnsFirstArgOfCall(*CI) &&
9022+
IsLowerToLibCall);
90219023
}
90229024

90239025
std::pair<SDValue, SDValue>
@@ -9041,7 +9043,8 @@ SelectionDAG::getMemcmp(SDValue Chain, const SDLoc &dl, SDValue Mem0,
90419043
GetEntry(getDataLayout().getIntPtrType(*getContext()), Size)};
90429044

90439045
TargetLowering::CallLoweringInfo CLI(*this);
9044-
bool IsTailCall = isTailCall(CI, this, /*LowerToLibCall*/ true);
9046+
bool IsTailCall =
9047+
isInTailCallPositionWrapper(CI, this, /*LowerToLibCall*/ true);
90459048

90469049
CLI.setDebugLoc(dl)
90479050
.setChain(Chain)
@@ -9122,7 +9125,7 @@ SDValue SelectionDAG::getMemcpy(
91229125
IsTailCall = *OverrideTailCall;
91239126
} else {
91249127
bool LowersToMemcpy = StringRef(MemCpyName) == StringRef("memcpy");
9125-
IsTailCall = isTailCall(CI, this, LowersToMemcpy);
9128+
IsTailCall = isInTailCallPositionWrapper(CI, this, LowersToMemcpy);
91269129
}
91279130

91289131
CLI.setDebugLoc(dl)
@@ -9236,7 +9239,7 @@ SDValue SelectionDAG::getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst,
92369239
} else {
92379240
bool LowersToMemmove =
92389241
TLI->getLibcallName(RTLIB::MEMMOVE) == StringRef("memmove");
9239-
IsTailCall = isTailCall(CI, this, LowersToMemmove);
9242+
IsTailCall = isInTailCallPositionWrapper(CI, this, LowersToMemmove);
92409243
}
92419244

92429245
CLI.setDebugLoc(dl)

0 commit comments

Comments
 (0)