Skip to content

Commit

Permalink
Rename push/pop helpers
Browse files Browse the repository at this point in the history
And delete the unused CORINFO_HELP_LLVM_EH_CATCH_POP_UNWOUND_VIRTUAL_FRAMES.
  • Loading branch information
SingleAccretion committed Aug 21, 2023
1 parent 59f5bc1 commit 2d1fb5c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 25 deletions.
5 changes: 2 additions & 3 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,12 +664,11 @@ enum CorInfoHelpFunc
CORINFO_HELP_LLVM_GET_OR_INIT_SHADOW_STACK_TOP,
CORINFO_HELP_LLVM_SET_SHADOW_STACK_TOP,
CORINFO_HELP_LLVM_EH_CATCH,
CORINFO_HELP_LLVM_EH_CATCH_POP_UNWOUND_VIRTUAL_FRAMES,
CORINFO_HELP_LLVM_EH_POP_UNWOUND_VIRTUAL_FRAMES,
CORINFO_HELP_LLVM_EH_PUSH_VIRTUAL_UNWIND_FRAME,
CORINFO_HELP_LLVM_EH_POP_VIRTUAL_UNWIND_FRAME,
CORINFO_HELP_LLVM_EH_UNHANDLED_EXCEPTION,
CORINFO_HELP_LLVM_RESOLVE_INTERFACE_CALL_TARGET,
CORINFO_HELP_LLVM_PUSH_VIRTUAL_UNWIND_FRAME,
CORINFO_HELP_LLVM_POP_VIRTUAL_UNWIND_FRAME,

CORINFO_HELP_COUNT,
};
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/inc/jithelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,11 @@
JITHELPER(CORINFO_HELP_LLVM_GET_OR_INIT_SHADOW_STACK_TOP, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_SET_SHADOW_STACK_TOP, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_EH_CATCH, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_EH_CATCH_POP_UNWOUND_VIRTUAL_FRAMES, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_EH_POP_UNWOUND_VIRTUAL_FRAMES, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_EH_PUSH_VIRTUAL_UNWIND_FRAME, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_EH_POP_VIRTUAL_UNWIND_FRAME, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_EH_UNHANDLED_EXCEPTION, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_RESOLVE_INTERFACE_CALL_TARGET, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_PUSH_VIRTUAL_UNWIND_FRAME, NULL, CORINFO_HELP_SIG_UNDEF)
JITHELPER(CORINFO_HELP_LLVM_POP_VIRTUAL_UNWIND_FRAME, NULL, CORINFO_HELP_SIG_UNDEF)

#undef JITHELPER
#undef DYNAMICJITHELPER
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/jit/llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,11 @@ bool Llvm::helperCallMayPhysicallyThrow(CorInfoHelpFunc helperFunc) const
{ FUNC(CORINFO_HELP_LLVM_GET_OR_INIT_SHADOW_STACK_TOP) CORINFO_TYPE_PTR, { }, HFIF_NO_RPI_OR_GC },
{ FUNC(CORINFO_HELP_LLVM_SET_SHADOW_STACK_TOP) CORINFO_TYPE_VOID, { CORINFO_TYPE_PTR }, HFIF_NO_RPI_OR_GC },
{ FUNC(CORINFO_HELP_LLVM_EH_CATCH) CORINFO_TYPE_CLASS, { CORINFO_TYPE_NATIVEUINT }, HFIF_SS_ARG },
{ FUNC(CORINFO_HELP_LLVM_EH_CATCH_POP_UNWOUND_VIRTUAL_FRAMES) CORINFO_TYPE_CLASS, { CORINFO_TYPE_NATIVEUINT }, HFIF_SS_ARG },
{ FUNC(CORINFO_HELP_LLVM_EH_POP_UNWOUND_VIRTUAL_FRAMES) CORINFO_TYPE_VOID, { }, HFIF_SS_ARG },
{ FUNC(CORINFO_HELP_LLVM_EH_PUSH_VIRTUAL_UNWIND_FRAME) CORINFO_TYPE_VOID, { CORINFO_TYPE_PTR, CORINFO_TYPE_PTR, CORINFO_TYPE_NATIVEUINT }, HFIF_NO_RPI_OR_GC },
{ FUNC(CORINFO_HELP_LLVM_EH_POP_VIRTUAL_UNWIND_FRAME) CORINFO_TYPE_VOID, { }, HFIF_NO_RPI_OR_GC },
{ FUNC(CORINFO_HELP_LLVM_EH_UNHANDLED_EXCEPTION) CORINFO_TYPE_VOID, { CORINFO_TYPE_CLASS }, HFIF_SS_ARG },
{ FUNC(CORINFO_HELP_LLVM_RESOLVE_INTERFACE_CALL_TARGET) CORINFO_TYPE_PTR, { CORINFO_TYPE_CLASS, CORINFO_TYPE_PTR }, HFIF_SS_ARG },
{ FUNC(CORINFO_HELP_LLVM_PUSH_VIRTUAL_UNWIND_FRAME) CORINFO_TYPE_VOID, { CORINFO_TYPE_PTR, CORINFO_TYPE_PTR, CORINFO_TYPE_NATIVEUINT }, HFIF_NO_RPI_OR_GC },
{ FUNC(CORINFO_HELP_LLVM_POP_VIRTUAL_UNWIND_FRAME) CORINFO_TYPE_VOID, { }, HFIF_NO_RPI_OR_GC },
};
// clang-format on

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/llvmlower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ PhaseStatus Llvm::AddVirtualUnwindFrame()
GenTree* unwindFrameLclAddr = m_compiler->gtNewLclVarAddrNode(unwindFrameLclNum);
GenTreeIntCon* initialUnwindIndexNode = m_compiler->gtNewIconNode(m_initialIndexValue, TYP_I_IMPL);
GenTreeCall* initializeCall =
m_compiler->gtNewHelperCallNode(CORINFO_HELP_LLVM_PUSH_VIRTUAL_UNWIND_FRAME, TYP_VOID,
m_compiler->gtNewHelperCallNode(CORINFO_HELP_LLVM_EH_PUSH_VIRTUAL_UNWIND_FRAME, TYP_VOID,
unwindFrameLclAddr, unwindTableAddrNode, initialUnwindIndexNode);
LIR::Range initRange;
initRange.InsertAtEnd(unwindFrameLclAddr);
Expand Down Expand Up @@ -1470,7 +1470,7 @@ PhaseStatus Llvm::AddVirtualUnwindFrame()
assert(lastNode->OperIs(GT_RETURN));

GenTreeCall* popCall =
m_compiler->gtNewHelperCallNode(CORINFO_HELP_LLVM_POP_VIRTUAL_UNWIND_FRAME, TYP_VOID);
m_compiler->gtNewHelperCallNode(CORINFO_HELP_LLVM_EH_POP_VIRTUAL_UNWIND_FRAME, TYP_VOID);
LIR::Range popCallRange;
popCallRange.InsertAtBeginning(popCall);
m_llvm->lowerRange(block, popCallRange);
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/jit/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1561,10 +1561,9 @@ void HelperCallProperties::init()
case CORINFO_HELP_LLVM_GET_OR_INIT_SHADOW_STACK_TOP:
case CORINFO_HELP_LLVM_SET_SHADOW_STACK_TOP:
case CORINFO_HELP_LLVM_EH_CATCH:
case CORINFO_HELP_LLVM_EH_CATCH_POP_UNWOUND_VIRTUAL_FRAMES:
case CORINFO_HELP_LLVM_EH_POP_UNWOUND_VIRTUAL_FRAMES:
case CORINFO_HELP_LLVM_PUSH_VIRTUAL_UNWIND_FRAME:
case CORINFO_HELP_LLVM_POP_VIRTUAL_UNWIND_FRAME:
case CORINFO_HELP_LLVM_EH_PUSH_VIRTUAL_UNWIND_FRAME:
case CORINFO_HELP_LLVM_EH_POP_VIRTUAL_UNWIND_FRAME:

noThrow = true;
mutatesHeap = true;
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,11 @@ which is the right helper to use to allocate an object of a given type. */
CORINFO_HELP_LLVM_GET_OR_INIT_SHADOW_STACK_TOP,
CORINFO_HELP_LLVM_SET_SHADOW_STACK_TOP,
CORINFO_HELP_LLVM_EH_CATCH,
CORINFO_HELP_LLVM_EH_CATCH_POP_UNWOUND_VIRTUAL_FRAMES,
CORINFO_HELP_LLVM_EH_POP_UNWOUND_VIRTUAL_FRAMES,
CORINFO_HELP_LLVM_EH_PUSH_VIRTUAL_UNWIND_FRAME,
CORINFO_HELP_LLVM_EH_POP_VIRTUAL_UNWIND_FRAME,
CORINFO_HELP_LLVM_EH_UNHANDLED_EXCEPTION,
CORINFO_HELP_LLVM_RESOLVE_INTERFACE_CALL_TARGET,
CORINFO_HELP_LLVM_PUSH_VIRTUAL_UNWIND_FRAME,
CORINFO_HELP_LLVM_POP_VIRTUAL_UNWIND_FRAME,

CORINFO_HELP_COUNT,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,24 +768,21 @@ private ISymbolNode GetHelperFtnUncached(CorInfoHelpFunc ftnNum)
case CorInfoHelpFunc.CORINFO_HELP_LLVM_EH_CATCH:
mangledName = "RhpHandleExceptionWasmCatch";
break;
case CorInfoHelpFunc.CORINFO_HELP_LLVM_EH_CATCH_POP_UNWOUND_VIRTUAL_FRAMES:
mangledName = "RhpHandleExceptionWasmCatchAndPopUnwoundVirtualFrames";
break;
case CorInfoHelpFunc.CORINFO_HELP_LLVM_EH_POP_UNWOUND_VIRTUAL_FRAMES:
mangledName = "RhpPopUnwoundVirtualFrames";
break;
case CorInfoHelpFunc.CORINFO_HELP_LLVM_EH_UNHANDLED_EXCEPTION:
mangledName = "RhpHandleUnhandledException";
break;
case CorInfoHelpFunc.CORINFO_HELP_LLVM_RESOLVE_INTERFACE_CALL_TARGET:
mangledName = "RhpResolveInterfaceDispatch";
break;
case CorInfoHelpFunc.CORINFO_HELP_LLVM_PUSH_VIRTUAL_UNWIND_FRAME:
case CorInfoHelpFunc.CORINFO_HELP_LLVM_EH_PUSH_VIRTUAL_UNWIND_FRAME:
mangledName = "RhpPushVirtualUnwindFrame";
break;
case CorInfoHelpFunc.CORINFO_HELP_LLVM_POP_VIRTUAL_UNWIND_FRAME:
case CorInfoHelpFunc.CORINFO_HELP_LLVM_EH_POP_VIRTUAL_UNWIND_FRAME:
mangledName = "RhpPopVirtualUnwindFrame";
break;
case CorInfoHelpFunc.CORINFO_HELP_LLVM_EH_UNHANDLED_EXCEPTION:
mangledName = "RhpHandleUnhandledException";
break;

default:
throw new NotImplementedException(ftnNum.ToString());
Expand Down

0 comments on commit 2d1fb5c

Please sign in to comment.