[llvm] [GlobalOpt] Add range metadata to loads from constant global variables (PR #127695)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 14:40:37 PST 2025


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 bedd3926f9eabf3f3965e0a817559c13073fc783 ad4e92e56d81c1d102a035eb798fda94ca859cda --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 2b05c9062a..d7f5fe5434 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2500,7 +2500,7 @@ OptimizeGlobalAliases(Module &M,
 }
 
 struct AccessPattern {
-  Type* Ty;
+  Type *Ty;
 
   APInt Stride;
   APInt Offset;
@@ -2595,7 +2595,7 @@ static bool addRangeMetadata(Module &M) {
       unsigned IndexBW = DL.getIndexTypeSizeInBits(GV->getType());
 
       struct PointerInfo {
-        Value* Ptr;
+        Value *Ptr;
 
         // Zero denotes not set
         APInt Stride;

``````````

</details>


https://github.com/llvm/llvm-project/pull/127695


More information about the llvm-commits mailing list