[llvm] [Coroutines] Make CoroElide actually work for (trivial) C++ coroutines (PR #92969)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 13:41:32 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 42944e4600827738fae868f0df831fb2678be8b4 778eb3c0cb299ed94b03437f3e49635ecf0a171c -- llvm/lib/Transforms/Coroutines/CoroElide.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Coroutines/CoroElide.cpp b/llvm/lib/Transforms/Coroutines/CoroElide.cpp
index 189e930825..d32fc150f7 100644
--- a/llvm/lib/Transforms/Coroutines/CoroElide.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroElide.cpp
@@ -297,9 +297,9 @@ static BasicBlock *getNullCheckerPredecessor(Value *Handle,
   assert(Cond);
   if (auto *Cmp = dyn_cast<ICmpInst>(Cond)) {
     auto ShouldCheckNe = BrInst->getSuccessor(0) == DestroyBB;
-    bool HasRequiredPredicate =
-        Cmp->getSignedPredicate() ==
-        (ShouldCheckNe ? CmpInst::Predicate::ICMP_NE : CmpInst::Predicate::ICMP_EQ);
+    bool HasRequiredPredicate = Cmp->getSignedPredicate() ==
+                                (ShouldCheckNe ? CmpInst::Predicate::ICMP_NE
+                                               : CmpInst::Predicate::ICMP_EQ);
     bool HasNullPtrOnOneSide = false;
     bool HasHandleOnOther = false;
 

``````````

</details>


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


More information about the llvm-commits mailing list