[llvm] [InstSimplify] Fix Inconsistent PHI Simplification (PR #113037)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 03:13:59 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 cf4442e6b10280a90982a161b91319ebd1235718 b37b385428195ba0b7f150d6443b725ad0a65c77 --extensions cpp -- llvm/lib/Analysis/InstructionSimplify.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 1860138849..f746f12390 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -5330,14 +5330,12 @@ static Value *getCommonPHIValue(Value *PreviousCommon, Value *Current,
                                                 PreviousCommonC, CurrentC,
                                                 NewCommonC, Q))
         return ConstantVector::get(NewCommonC);
-    }
-    else if (auto *ArrayTy = dyn_cast<ArrayType>(Ty)) {
+    } else if (auto *ArrayTy = dyn_cast<ArrayType>(Ty)) {
       if (getCommonPHIValueForAggregateOrVector(ArrayTy->getNumElements(),
                                                 PreviousCommonC, CurrentC,
                                                 NewCommonC, Q))
         return ConstantArray::get(ArrayTy, NewCommonC);
-    }
-    else if (auto *StructTy = dyn_cast<StructType>(Ty)) {
+    } else if (auto *StructTy = dyn_cast<StructType>(Ty)) {
       if (getCommonPHIValueForAggregateOrVector(StructTy->getNumElements(),
                                                 PreviousCommonC, CurrentC,
                                                 NewCommonC, Q))

``````````

</details>


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


More information about the llvm-commits mailing list