Skip to content

Refactor Inlining. NFC. #31306

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

Merged
merged 1 commit into from
Mar 12, 2019
Merged

Refactor Inlining. NFC. #31306

merged 1 commit into from
Mar 12, 2019

Conversation

Keno
Copy link
Member

@Keno Keno commented Mar 9, 2019

I'm working on some problems that require some slightly different
characteristics than our default inliner. While working on that,
I got frustrated by some of the accumulated cruft and structuring
of the inliner, so I decided to spend some time to clean it. This
doesn't change any behavior, but moves some of the code around,
drops now-unused arguments and properties and introduces a Signature
struct to encapsulate the (f, ft, atypes, atype) tuple we passed around
everywhere.

@Keno Keno requested a review from vtjnash March 10, 2019 01:23
@Keno Keno force-pushed the kf/refactorinlining branch 2 times, most recently from 895daef to 849a371 Compare March 10, 2019 03:15
@StefanKarpinski
Copy link
Member

Note: better viewed with ignore whitespace turned on.

Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

I just glanced though it so far, but seems to be generally reasonable

f = isdefined(ft, :instance) ? ft.instance : nothing
return svec(f, ft, atypes, argexprs, invoke_data)
f = singleton_type(ft)
return svec(Signature(f, ft, atypes), invoke_data)
Copy link
Member

Choose a reason for hiding this comment

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

can just return a tuple now

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

if late_inline_special_case!(ir, sig, idx, stmt) || is_return_type(sig.f)
return nothing
end
return (sig, invoke_data)
Copy link
Member

Choose a reason for hiding this comment

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

perhaps should be an svec

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the same signature as the other one above. I'll just leave it as a tuple.

I'm working on some problems that require some slightly different
characteristics than our default inliner. While working on that,
I got frustrated by some of the accumulated cruft and structuring
of the inliner, so I decided to spend some time to clean it. This
doesn't change any behavior, but moves some of the code around,
drops now-unused arguments and properties and introduces a `Signature`
struct to encapsulate the (f, ft, atypes, atype) tuple we passed around
everywhere.
@Keno Keno force-pushed the kf/refactorinlining branch from 849a371 to cfb4dfc Compare March 11, 2019 22:28
@Keno Keno merged commit e949f89 into master Mar 12, 2019
@vchuravy vchuravy deleted the kf/refactorinlining branch March 12, 2019 14:10
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.

3 participants