[llvm] [InstCombine] Move nonnull assumptions to the base of a gep (PR #195650)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 06:20:58 PDT 2026


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 origin/main HEAD --extensions cpp -- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 1924d99c0..a22d69ee1 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -3717,7 +3717,8 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
         }
 
         // Move assume to the base pointer of a gep if it's inbounds
-        if (auto *GEP = dyn_cast<GEPOperator>(RK.WasOn); GEP && GEP->isInBounds()) {
+        if (auto *GEP = dyn_cast<GEPOperator>(RK.WasOn);
+            GEP && GEP->isInBounds()) {
           while (true) {
             auto *NextGEP = dyn_cast<GEPOperator>(GEP->getPointerOperand());
             if (!NextGEP || !NextGEP->isInBounds())

``````````

</details>


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


More information about the llvm-commits mailing list