Add divmod functions to RuntimeLibcalls.def #68462
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially addresses #46350 by adding
__{,u}divmod{s,d,t}i4
entries toRuntimeLibcalls.def
. These functions exist incompiler-rt
and appear to exist inlibgcc
, so it should be safe to emit calls to them.__{,u}divmod{q,h}i4
are not included due to not having generic implementations incompiler-rt
(though they are enabled for specific targets for which they have optimized implementations).__{,u}divmodti4
do not appear to be built for 32-bit platforms, though neither are__{,u}{div,mod}ti3
, but they still haveRuntimeLibcalls.def
entries despite that.This does not include optimizations (or de-optimizations) to better prepare the code generator to emit calls to these, but is instead meant to serve as a first step to optimizing these kinds of situations.