Skip to content

Conversation

@topolarity
Copy link
Member

We need to revert this for now. Resolves #58911

It seems that the back-end LLVM emits this libcall a lot less often than it used to, but it still happens sometimes and 32-bit Windows has no implementation of __divti3.

…liaLang#53867)"

This reverts commit 13d4f0e.

It turns out that LLVM still emits libcalls to `__divti3` in some
scenarios (JuliaLang#58911).
@topolarity topolarity requested a review from oscardssmith August 5, 2025 18:06
@topolarity topolarity added the backport 1.12 Change should be backported to release-1.12 label Aug 5, 2025
@oscardssmith
Copy link
Member

oscardssmith commented Aug 5, 2025

Can we only revert the div/rem part of these changes? It looks like * works now.

@topolarity
Copy link
Member Author

I think we can try that on master where we have some time to catch lingering regressions.

Since we were bitten by this over a year after the original PR merged, I'd prefer to do a full revert for 1.12 just to be safe.

@gbaraldi
Copy link
Member

gbaraldi commented Aug 5, 2025

If llvm is just emitting libcalls here we should just revert the whole thing, it's not like the performance of this matters too much (128 bit on 32bit). The other option is to vendor a C implementation of this and link it in, but LLVM has issues with finding those sometimes

@oscardssmith
Copy link
Member

oscardssmith commented Aug 5, 2025

IIUC LLVM is only emitting libcalls here because it is missing the lowering of these operations. The reason I had hoped to leave this to LLVM is I trust them to have better lowerings (e.g. using add with carry functions) which they appear to do for all backends except 32 bit windows.

That said, I don't object to a full revert (at least for the backports).

@topolarity topolarity merged commit 3ee0bb9 into JuliaLang:master Aug 5, 2025
9 checks passed
@topolarity
Copy link
Member Author

Merged the full revert for now, but please free to re-land a modified version of the change for master @oscardssmith

topolarity added a commit that referenced this pull request Aug 5, 2025
…3867)" (#59211)

We need to revert this for now. Resolves
#58911

It seems that the back-end LLVM emits this libcall a lot less often than
it used to, but it still happens sometimes and 32-bit Windows has no
implementation of `__divti3`.
@topolarity topolarity removed the backport 1.12 Change should be backported to release-1.12 label Aug 5, 2025
@giordano
Copy link
Member

giordano commented Aug 5, 2025

I'm a bit late to the party, but perhaps comments in the code to explain why those methods are still needed would be useful. Commit message has some explanation (great!), but it requires a git blame to find the rationale.

KristofferC pushed a commit that referenced this pull request Sep 5, 2025
…3867)" (#59211)

We need to revert this for now. Resolves
#58911

It seems that the back-end LLVM emits this libcall a lot less often than
it used to, but it still happens sometimes and 32-bit Windows has no
implementation of `__divti3`.
KristofferC pushed a commit that referenced this pull request Sep 15, 2025
…3867)" (#59211)

We need to revert this for now. Resolves
#58911

It seems that the back-end LLVM emits this libcall a lot less often than
it used to, but it still happens sometimes and 32-bit Windows has no
implementation of `__divti3`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT session error: Symbols not found: [ __udivti3 ] on 32-bit 1.12 only

4 participants