[llvm] [CodeGen] Do not emit TRAP for `unreachable` after `@llvm.trap` (PR #94570)
    Matt Arsenault via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Jun 10 07:53:15 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");
----------------
arsenm wrote:
It's not obvious to me why this attribute matters. Could this just be any noreturn intrinsic? 
https://github.com/llvm/llvm-project/pull/94570
    
    
More information about the llvm-commits
mailing list