Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix isa tfunc for type kinds #22779

Merged
merged 1 commit into from
Jul 12, 2017
Merged

fix isa tfunc for type kinds #22779

merged 1 commit into from
Jul 12, 2017

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Jul 12, 2017

previously, isa_tfunc(DataType, Type{...}) might return Const(false)

@vtjnash vtjnash added backport pending 0.5 bugfix This change fixes an existing bug compiler:inference Type inference labels Jul 12, 2017
@Keno
Copy link
Member

Keno commented Jul 12, 2017

Add some version of the original problematic code to the test?

previously, isa_tfunc(DataType, Type{...}) might return Const(false)
@vtjnash
Copy link
Member Author

vtjnash commented Jul 12, 2017

It's in there; I just reduced it to the precise MWE and unit-tested that.

@Keno
Copy link
Member

Keno commented Jul 12, 2017

You're whitebox testing tfuncs though. I'd much prefer a test along the lines of the original code.

const n_ifunc = reinterpret(Int32, arraylen) + 1
const t_ifunc = Array{Tuple{Int, Int, Any}, 1}(n_ifunc)
const t_ifunc_cost = Array{Int, 1}(n_ifunc)
const t_ffunc_key = Array{Any, 1}(0)
Copy link
Member

@JeffBezanson JeffBezanson Jul 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we putting any non-Functions in here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah – actually we only put Builtin subtypes in here. This should just be more likely to trigger our anti-specialization heuristics and avoid trying to put convert and typeassert into the code path.

@vtjnash
Copy link
Member Author

vtjnash commented Jul 12, 2017

You're whitebox testing tfuncs though. I'd much prefer a test along the lines of the original code.

I think you mean unit-testing, and that you would like to also see an integration test? Adding a test for the original failure would also be a whitebox test. However, I'm not sure that the integration test is necessary in this case. We already have a couple tests in this file to show that integration works, so I think we were just missing some of the cases for unit testing.

@JeffBezanson JeffBezanson merged commit 7c31c41 into master Jul 12, 2017
@JeffBezanson
Copy link
Member

@vtjnash I suspect this might not backport cleanly, and you might need to rebase it for 0.6 (and almost certainly for 0.5) manually.

@StefanKarpinski StefanKarpinski deleted the jn/isa_tfunc_bugfix branch July 12, 2017 21:55
@Keno Keno mentioned this pull request Jul 30, 2017
ararslan pushed a commit that referenced this pull request Sep 11, 2017
fix isa tfunc for type kinds

Ref #22779
(cherry picked from commit 7c31c41)
@ararslan
Copy link
Member

@vtjnash I'm not sure how to backport this properly to 0.6. Could you submit this change as a PR to the release-0.6 branch?

vtjnash added a commit that referenced this pull request Sep 13, 2017
previously, isa_tfunc(DataType, Type{...}) might return Const(false)

(cherry picked from commit cd959a2, PR #22779)
ararslan pushed a commit that referenced this pull request Sep 14, 2017
previously, isa_tfunc(DataType, Type{...}) might return Const(false)

(cherry picked from commit cd959a2, PR #22779)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants