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

A few inference/codegen optimizations #22425

Merged
merged 1 commit into from
Jun 21, 2017
Merged

A few inference/codegen optimizations #22425

merged 1 commit into from
Jun 21, 2017

Conversation

yuyichao
Copy link
Contributor

  • Infer Core.sizeof constant results
  • Inline Core.sizeof in codegen
  • Optimize jl_string_str

Fix #22422

src/codegen.cpp Outdated
JL_GC_POP();
return true;
}
else if (((jl_datatype_t*)sty)->name == jl_array_typename) {
Copy link
Member

Choose a reason for hiding this comment

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

Check if sty is a datatype first

@yuyichao yuyichao force-pushed the yyc/codegen/sizeof branch 2 times, most recently from f5b4ba8 to 1ecf678 Compare June 18, 2017 16:55
@ararslan ararslan added compiler:codegen Generation of LLVM IR and native code compiler:inference Type inference labels Jun 18, 2017
@Keno
Copy link
Member

Keno commented Jun 18, 2017

Add a codegen test?

@JeffBezanson
Copy link
Member

Would also be good to have tests for the sizeof tfunc.

@yuyichao
Copy link
Contributor Author

Yes, trying to add that...

@yuyichao
Copy link
Contributor Author

Rebased on top of #22455 (for test/codegen.jl) and added tests...


function test_const_return(f::ANY, t::ANY, val::ANY)
linfo = get_linfo(f, t)
# If converage is not enabled, make the check strict by requiring constant ABI
Copy link
Contributor

Choose a reason for hiding this comment

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

coverage

* Infer `Core.sizeof` constant results
* Inline `Core.sizeof` in codegen
* Optimize `jl_string_str`

Fix #22422
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants