[llvm] [CodeGen] Avoid generating trap instructions after exception restore intrinsics (PR #109560)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 21 21:47:25 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 2c770675ce36402b51a320ae26f369690c138dc1 3daa4022a395ba939b26fc6f239b89a878456e27 --extensions cpp -- llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index 7cf6e4d55c..02f4d52738 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -3127,7 +3127,8 @@ bool IRTranslator::translateUnreachable(const User &U, MachineIRBuilder &MIRBuil
       return true;
     // Do not emit trap instructions after EH_RETURN intrinsics.
     // This can cause problems later down the line when other machine passes
-    // attempt to use the last instruction in a BB to determine terminator behavior.
+    // attempt to use the last instruction in a BB to determine terminator
+    // behavior.
     if (const auto *II = dyn_cast<IntrinsicInst>(Call)) {
       const auto IID = II->getIntrinsicID();
       if (IID == Intrinsic::eh_return_i32 || IID == Intrinsic::eh_return_i64)
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 8ca1aa0278..ebae2517a5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3555,7 +3555,8 @@ void SelectionDAGBuilder::visitUnreachable(const UnreachableInst &I) {
       return;
     // Do not emit trap instructions after EH_RETURN intrinsics.
     // This can cause problems later down the line when other machine passes
-    // attempt to use the last instruction in a BB to determine terminator behavior.
+    // attempt to use the last instruction in a BB to determine terminator
+    // behavior.
     if (const auto *II = dyn_cast<IntrinsicInst>(Call)) {
       const auto IID = II->getIntrinsicID();
       if (IID == Intrinsic::eh_return_i32 || IID == Intrinsic::eh_return_i64)

``````````

</details>


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


More information about the llvm-commits mailing list