[llvm] [PredicateInfo] Use bitcast instead of ssa.copy (PR #151174)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 08:44:58 PDT 2025


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 HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/Transforms/Utils/PredicateInfo.h llvm/lib/Transforms/IPO/FunctionSpecialization.cpp llvm/lib/Transforms/Scalar/NewGVN.cpp llvm/lib/Transforms/Utils/PredicateInfo.cpp llvm/lib/Transforms/Utils/SCCPSolver.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
index 3df3495f8..047650a88 100644
--- a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
+++ b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
@@ -14,8 +14,9 @@
 /// Copies of these operations are inserted into the true/false edge (and after
 /// assumes), and information attached to the copies.  All uses of the original
 /// operation in blocks dominated by the true/false edge (and assume), are
-/// replaced with uses of the copies.  This enables passes to easily and sparsely
-/// propagate condition based info into the operations that may be affected.
+/// replaced with uses of the copies.  This enables passes to easily and
+/// sparsely propagate condition based info into the operations that may be
+/// affected.
 ///
 /// Example:
 /// %cmp = icmp eq i32 %x, 50
@@ -40,9 +41,9 @@
 /// comparison, which tells you x.0 is 50.
 ///
 /// In order to reduce the number of copies inserted, predicateinfo is only
-/// inserted where it would actually be live.  This means if there are no uses of
-/// an operation dominated by the branch edges, or by an assume, the associated
-/// predicate info is never inserted.
+/// inserted where it would actually be live.  This means if there are no uses
+/// of an operation dominated by the branch edges, or by an assume, the
+/// associated predicate info is never inserted.
 ///
 ///
 //===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
index ffc8e477b..02420fa8a 100644
--- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp
+++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
@@ -755,7 +755,7 @@ static void replaceCreatedSSACopys(PredicateInfo &PredInfo, Function &F) {
       continue;
 
     assert(isa<BitCastInst>(Inst) &&
-          Inst.getType() == Inst.getOperand(0)->getType());
+           Inst.getType() == Inst.getOperand(0)->getType());
     Inst.replaceAllUsesWith(Inst.getOperand(0));
     Inst.eraseFromParent();
   }

``````````

</details>


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


More information about the llvm-commits mailing list