Skip to content

Commit a404747

Browse files
committed
address comment
1 parent b3bf591 commit a404747

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,10 +1256,9 @@ class SelectionDAG {
12561256
/// stack arguments from being clobbered.
12571257
LLVM_ABI SDValue getStackArgumentTokenFactor(SDValue Chain);
12581258

1259-
LLVM_ABI std::pair<SDValue, SDValue> getMemcmp(SDValue Chain, const SDLoc &dl,
1260-
SDValue Dst, SDValue Src,
1261-
SDValue Size,
1262-
const CallInst *CI);
1259+
std::pair<SDValue, SDValue> getMemcmp(SDValue Chain, const SDLoc &dl,
1260+
SDValue Dst, SDValue Src, SDValue Size,
1261+
const CallInst *CI);
12631262
LLVM_ABI std::pair<SDValue, SDValue>
12641263
getStrlen(SDValue Chain, const SDLoc &dl, SDValue Src, const CallInst *CI);
12651264

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9115,17 +9115,8 @@ std::pair<SDValue, SDValue> SelectionDAG::getStrlen(SDValue Chain,
91159115

91169116
TargetLowering::CallLoweringInfo CLI(*this);
91179117

9118-
// TODO: Intentionally not marking this libcall as a tail call.
9119-
//
9120-
// Why:
9121-
// - The only current in-tree user of SelectionDAG::getStrlen is the AIX path,
9122-
// where generic tail-calling to libcalls is not safe due to ABI
9123-
// constraints around r2 (TOC). We don¡¯t have a reliable way to validate a
9124-
// tail call here.
9125-
//
9126-
// If another target starts using this and does support tail calls to
9127-
// libcalls, re-enable `.setTailCall(...)` under a target guard and add a
9128-
// test.
9118+
// TODO: propagate tail call flag for targets where that is safe. Note
9119+
// that it is not safe on AIX which is the only current target.
91299120
CLI.setDebugLoc(dl).setChain(Chain).setLibCallee(
91309121
TLI->getLibcallCallingConv(RTLIB::STRLEN), CI->getType(),
91319122
getExternalSymbol(LibCallName, TLI->getProgramPointerTy(getDataLayout())),

0 commit comments

Comments
 (0)