[llvm] [InstCombine] Support nested GEPs in OptimizePointerDifference (PR #142958)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 5 05:46:12 PDT 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 HEAD~1 HEAD --extensions cpp -- llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
index eb5537717..4b6958618 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -2140,7 +2140,6 @@ Value *InstCombinerImpl::OptimizePointerDifference(Value *LHS, Value *RHS,
if (!Base.Ptr)
return nullptr;
-
// To avoid duplicating the offset arithmetic, rewrite the GEP to use the
// computed offset.
// TODO: We should probably do this even if there is only one GEP.
``````````
</details>
https://github.com/llvm/llvm-project/pull/142958
More information about the llvm-commits
mailing list