[llvm] [InstCombine] simplify `x (comp) ~x` (PR #73990)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 13:46:32 PST 2023


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 1b02f594b337618e2e5808a33620eeac19d10e06 bac64b37174e16c41a2d84bab5eef434e6cf86a8 -- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index f49cf31ffa..c42f543c6b 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -620,12 +620,12 @@ static Value *rewriteGEPAsOffset(Type *ElemTy, Value *Start, Value *Base,
     setInsertionPoint(Builder, Val, false);
 
     // Cast base to the expected type.
-    Value *NewVal = Builder.CreateBitOrPointerCast(
-        Base, PtrTy, Start->getName() + "to.ptr");
+    Value *NewVal = Builder.CreateBitOrPointerCast(Base, PtrTy,
+                                                   Start->getName() + "to.ptr");
     NewVal = Builder.CreateInBoundsGEP(ElemTy, NewVal, ArrayRef(NewInsts[Val]),
                                        Val->getName() + ".ptr");
-    NewVal = Builder.CreateBitOrPointerCast(
-        NewVal, Val->getType(), Val->getName() + ".conv");
+    NewVal = Builder.CreateBitOrPointerCast(NewVal, Val->getType(),
+                                            Val->getName() + ".conv");
     IC.replaceInstUsesWith(*cast<Instruction>(Val), NewVal);
     // Add old instruction to worklist for DCE. We don't directly remove it
     // here because the original compare is one of the users.

``````````

</details>


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


More information about the llvm-commits mailing list