[llvm] [InstCombine] Try to fold add into GEP x, C (PR #85090)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 07:46:57 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 e371ada409b225ea990b5ac0d5cafea26a6046e1 adeb2874f9cf45e9125438397d15248ad3b0051f -- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 7932822c0f..a88cb55b67 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -2918,7 +2918,7 @@ Instruction *InstCombinerImpl::visitGetElementPtrInst(GetElementPtrInst &GEP) {
           Instruction *Add = cast<Instruction>(*I);
           *I = X;
           *Next = ConstantInt::get((*Next)->getType(),
-                                    *C2 + *C1 * (Scale1 / Scale2));
+                                   *C2 + *C1 * (Scale1 / Scale2));
           addToWorklist(Add);
           return &GEP;
         }

``````````

</details>


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


More information about the llvm-commits mailing list