[clang] [llvm] [ARM] Fix musttail calls (PR #109943)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 25 02:53:20 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff b75174d05aa033a382d4c088e96e068a774f46da 5ec1238756677fc68d3a4081b3d58e930d24b9ac --extensions cpp -- clang/test/CodeGen/musttail-sret.cpp clang/lib/CodeGen/CGCall.cpp llvm/lib/Target/ARM/ARMISelLowering.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index dfb401487e..6552280214 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -3015,11 +3015,12 @@ bool ARMTargetLowering::IsEligibleForTailCallOptimization(
// a return to the hardware. Tail-calling another function would probably
// break this.
if (CallerF.hasFnAttribute("interrupt")) {
- LLVM_DEBUG(dbgs() << "false (interrupt attribute)\n");
+ LLVM_DEBUG(dbgs() << "false (interrupt attribute)\n");
return false;
}
- if (canGuaranteeTCO(CalleeCC, getTargetMachine().Options.GuaranteedTailCallOpt)) {
+ if (canGuaranteeTCO(CalleeCC,
+ getTargetMachine().Options.GuaranteedTailCallOpt)) {
LLVM_DEBUG(dbgs() << (CalleeCC == CallerCC ? "true" : "false")
<< " (guaranteed tail-call CC)\n");
return CalleeCC == CallerCC;
@@ -3030,7 +3031,7 @@ bool ARMTargetLowering::IsEligibleForTailCallOptimization(
bool isCalleeStructRet = Outs.empty() ? false : Outs[0].Flags.isSRet();
bool isCallerStructRet = MF.getFunction().hasStructRetAttr();
if (isCalleeStructRet != isCallerStructRet) {
- LLVM_DEBUG(dbgs() << "false (struct-ret)\n");
+ LLVM_DEBUG(dbgs() << "false (struct-ret)\n");
return false;
}
@@ -3045,7 +3046,8 @@ bool ARMTargetLowering::IsEligibleForTailCallOptimization(
const GlobalValue *GV = G->getGlobal();
const Triple &TT = getTargetMachine().getTargetTriple();
if (GV->hasExternalWeakLinkage() &&
- (!TT.isOSWindows() || TT.isOSBinFormatELF() || TT.isOSBinFormatMachO())) {
+ (!TT.isOSWindows() || TT.isOSBinFormatELF() ||
+ TT.isOSBinFormatMachO())) {
LLVM_DEBUG(dbgs() << "false (external weak linkage)\n");
return false;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/109943
More information about the cfe-commits
mailing list