[llvm] [AArch64] Don't tail call memset if it would convert to a bzero. (PR #98969)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 10:32:42 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 e6ec7c8f74d1be778f4ddf794d0e2fb63b0dc3be 5aad864dec2a452a1367f118bf8c722317c7cceb --extensions h,cpp -- llvm/include/llvm/CodeGen/Analysis.h llvm/include/llvm/CodeGen/SelectionDAG.h llvm/lib/CodeGen/Analysis.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp
index 7514e33d47..a34fc6c28c 100644
--- a/llvm/lib/CodeGen/Analysis.cpp
+++ b/llvm/lib/CodeGen/Analysis.cpp
@@ -743,13 +743,13 @@ bool llvm::returnTypeIsEligibleForTailCall(const Function *F,
}
bool llvm::funcReturnsFirstArgOfCall(const CallInst &CI) {
- const ReturnInst *Ret = dyn_cast<ReturnInst>(CI.getParent()->getTerminator());
- Value *RetVal = Ret ? Ret->getReturnValue() : nullptr;
- bool ReturnsFirstArg = false;
- if (RetVal && ((RetVal == CI.getArgOperand(0) ||
- isPointerBitcastEqualTo(RetVal, CI.getArgOperand(0)))))
- ReturnsFirstArg = true;
- return ReturnsFirstArg;
+ const ReturnInst *Ret = dyn_cast<ReturnInst>(CI.getParent()->getTerminator());
+ Value *RetVal = Ret ? Ret->getReturnValue() : nullptr;
+ bool ReturnsFirstArg = false;
+ if (RetVal && ((RetVal == CI.getArgOperand(0) ||
+ isPointerBitcastEqualTo(RetVal, CI.getArgOperand(0)))))
+ ReturnsFirstArg = true;
+ return ReturnsFirstArg;
}
static void collectEHScopeMembers(
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index b17a5815c1..155d33ce78 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6502,8 +6502,8 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
bool isVol = MSI.isVolatile();
SDValue Root = isVol ? getRoot() : getMemoryRoot();
SDValue MS = DAG.getMemset(
- Root, sdl, Op1, Op2, Op3, Alignment, isVol, /* AlwaysInline */ false, &I,
- MachinePointerInfo(I.getArgOperand(0)), I.getAAMetadata());
+ Root, sdl, Op1, Op2, Op3, Alignment, isVol, /* AlwaysInline */ false,
+ &I, MachinePointerInfo(I.getArgOperand(0)), I.getAAMetadata());
updateDAGForMaybeTailCall(MS);
return;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/98969
More information about the llvm-commits
mailing list