[llvm] [InstCombine] Remove dead phi web (PR #108876)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 17:09: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 e5271fef8fd8931370f04702ba2f9e8b2ab0e523 99157f32fc815212628e75f28071edb804703c50 --extensions h,cpp -- llvm/lib/Transforms/InstCombine/InstCombineInternal.h llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
index 5e567c738f..a2c45475e5 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
@@ -635,7 +635,7 @@ public:
   Instruction *foldPHIArgIntToPtrToPHI(PHINode &PN);
 
   // If the phi is within a phi web, which is formed by the def-use chain
-  // of phis and all the phis in the web are only used in the other phis. 
+  // of phis and all the phis in the web are only used in the other phis.
   // In this case, these phis are dead and we will remove all of them.
   bool foldDeadPhiWeb(PHINode &PN);
 
diff --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
index 8ed3be6bc4..347db2d5dd 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
@@ -54,9 +54,9 @@ void InstCombinerImpl::PHIArgMergedDebugLoc(Instruction *Inst, PHINode &PN) {
 }
 
 // If the phi is within a phi web, which is formed by the def-use chain
-// of phis and all the phis in the web are only used in the other phis. 
+// of phis and all the phis in the web are only used in the other phis.
 // In this case, these phis are dead and we will remove all of them.
-bool InstCombinerImpl::foldDeadPhiWeb(PHINode &PN){
+bool InstCombinerImpl::foldDeadPhiWeb(PHINode &PN) {
   SmallVector<PHINode *, 16> Stack;
   SmallPtrSet<PHINode *, 16> Visited;
   Stack.push_back(&PN);
@@ -1004,7 +1004,6 @@ Instruction *InstCombinerImpl::foldPHIArgOpIntoPHI(PHINode &PN) {
   return NewCI;
 }
 
-
 /// Return true if this phi node is always equal to NonPhiInVal.
 /// This happens with mutually cyclic phi nodes like:
 ///   z = some value; x = phi (y, z); y = phi (x, z)

``````````

</details>


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


More information about the llvm-commits mailing list