-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve constant prop in gcd (#41258)
With this PR: ```julia julia> f(x) = x * (2//3) f (generic function with 1 method) julia> @code_typed f(2.3) CodeInfo( 1 ─ %1 = Base.mul_float(x, 0.6666666666666666)::Float64 └── return %1 ) => Float64 ``` It is a bit unfortunate to have to resort to `@pure` here, but I could not get it to constant fold any other way. I don't think this usage should be problematic since the method only accepts `BitInteger`s and only ever calls methods that really shouldn't be redefined. fixes #32024
- Loading branch information
1 parent
073af4a
commit 0cbb685
Showing
2 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters