[llvm] [CodeGen] Do not emit TRAP for `unreachable` after `@llvm.trap` (PR #94570)

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 13:57:46 PDT 2024


================
@@ -1836,6 +1837,16 @@ class CallInst : public CallBase {
   bool canReturnTwice() const { return hasFnAttr(Attribute::ReturnsTwice); }
   void setCanReturnTwice() { addFnAttr(Attribute::ReturnsTwice); }
 
+  bool isNonContinuableTrap() const {
+    switch (getIntrinsicID()) {
+    case Intrinsic::trap:
+    case Intrinsic::ubsantrap:
+      return !hasFnAttr("trap-func-name");
----------------
igorkudrin wrote:

I don't have enough information to tell if this is a bug, but it is definitely out of the scope of this patch.

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


More information about the llvm-commits mailing list