Index: llvm/include/llvm/IR/Intrinsics.td =================================================================== --- llvm/include/llvm/IR/Intrinsics.td +++ llvm/include/llvm/IR/Intrinsics.td @@ -120,6 +120,8 @@ def IntrNoReturn : IntrinsicProperty; +def IntrReturnsTwice : IntrinsicProperty; + // IntrNoSync - Threads executing the intrinsic will not synchronize using // memory or other means. Applied by default. def IntrNoSync : IntrinsicProperty<1>; @@ -984,7 +986,8 @@ def int_eh_sjlj_callsite : Intrinsic<[], [llvm_i32_ty], [IntrNoMem]>; def int_eh_sjlj_functioncontext : Intrinsic<[], [llvm_ptr_ty]>; -def int_eh_sjlj_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>; +def int_eh_sjlj_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty], + [IntrReturnsTwice]>; def int_eh_sjlj_longjmp : Intrinsic<[], [llvm_ptr_ty], [IntrNoReturn]>; def int_eh_sjlj_setup_dispatch : Intrinsic<[], []>; Index: llvm/utils/TableGen/CodeGenIntrinsics.h =================================================================== --- llvm/utils/TableGen/CodeGenIntrinsics.h +++ llvm/utils/TableGen/CodeGenIntrinsics.h @@ -126,6 +126,9 @@ /// True if the intrinsic is no-return. bool isNoReturn; + /// True if the intrinsic is returns-twice. + bool isReturnsTwice; + /// True if the intrinsic is no-sync. bool isNoSync; Index: llvm/utils/TableGen/CodeGenTarget.cpp =================================================================== --- llvm/utils/TableGen/CodeGenTarget.cpp +++ llvm/utils/TableGen/CodeGenTarget.cpp @@ -666,6 +666,7 @@ isCommutative = false; canThrow = false; isNoReturn = false; + isReturnsTwice = false; isNoSync = false; isNoFree = false; isWillReturn = false; @@ -867,6 +868,8 @@ isConvergent = true; else if (R->getName() == "IntrNoReturn") isNoReturn = true; + else if (R->getName() == "IntrReturnsTwice") + isReturnsTwice = true; else if (R->getName() == "IntrNoSync") isNoSync = true; else if (R->getName() == "IntrNoFree") Index: llvm/utils/TableGen/IntrinsicEmitter.cpp =================================================================== --- llvm/utils/TableGen/IntrinsicEmitter.cpp +++ llvm/utils/TableGen/IntrinsicEmitter.cpp @@ -590,6 +590,9 @@ if (L->isNoReturn != R->isNoReturn) return R->isNoReturn; + if (L->isReturnsTwice != R->isReturnsTwice) + return R->isReturnsTwice; + if (L->isNoSync != R->isNoSync) return R->isNoSync; @@ -739,7 +742,8 @@ if (!Intrinsic.canThrow || (Intrinsic.ModRef != CodeGenIntrinsic::ReadWriteMem && !Intrinsic.hasSideEffects) || - Intrinsic.isNoReturn || Intrinsic.isNoSync || Intrinsic.isNoFree || + Intrinsic.isNoReturn || Intrinsic.isReturnsTwice || + Intrinsic.isNoSync || Intrinsic.isNoFree || Intrinsic.isWillReturn || Intrinsic.isCold || Intrinsic.isNoDuplicate || Intrinsic.isNoMerge || Intrinsic.isConvergent || Intrinsic.isSpeculatable) { @@ -749,6 +753,8 @@ OS << LS << "Attribute::NoUnwind"; if (Intrinsic.isNoReturn) OS << LS << "Attribute::NoReturn"; + if (Intrinsic.isReturnsTwice) + OS << LS << "Attribute::ReturnsTwice"; if (Intrinsic.isNoSync) OS << LS << "Attribute::NoSync"; if (Intrinsic.isNoFree)