[llvm] [GlobalOpt] Handle operators separately when removing GV users (PR #84694)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 20 20:26:51 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 1d5d18924d185a4267462479307f1ff9911cb112 bd763710224f86d52b252704821f403308cb3566 --extensions cpp -- llvm/lib/Transforms/IPO/GlobalOpt.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 497e23c136..2bdd469459 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -188,9 +188,9 @@ static bool isSafeComputationToRemove(
/// We just marked GV constant. Loop over all users of the global, cleaning up
/// the obvious ones. This is largely just a quick scan over the use list to
/// clean up the easy and obvious cruft. This returns true if it made a change.
-static bool cleanupConstantGlobalUsers(GlobalVariable *GV,
- const DataLayout &DL,
- function_ref<TargetLibraryInfo &(Function &)> GetTLI) {
+static bool cleanupConstantGlobalUsers(
+ GlobalVariable *GV, const DataLayout &DL,
+ function_ref<TargetLibraryInfo &(Function &)> GetTLI) {
Constant *Init = GV->getInitializer();
SmallVector<User *, 8> WorkList(GV->users());
SmallPtrSet<User *, 8> Visited;
``````````
</details>
https://github.com/llvm/llvm-project/pull/84694
More information about the llvm-commits
mailing list