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

llvmcall: use AlwaysInliner + test inlining behavior #18409

Merged
merged 3 commits into from
Sep 25, 2016
Merged

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Sep 8, 2016

  • use LLVM's AlwaysInliner to inline llvmcall functions (doesn't affect non-AlwaysInline functions)
  • allow passing Function*'s generated by julia into llvmcall, which isn't very useful but allows us to
  • test the llvmcall inlining behavior

cc @Keno, you mentioned in a comment this approach can't work; is there any disadvantage of waiting until JIT (or jl_get_llvmf_defn + manual optim) to inline functions?

@vtjnash
Copy link
Member

vtjnash commented Sep 8, 2016

While this is pretty close to how these functions happen to work now, I'm not sure that we fully want to define them this way. But since llvmcall should get deprecated anyways, I guess I don't care particularly.

That particular comment is out-of-date since #15556.

@maleadt maleadt force-pushed the tb/always_inline branch 3 times, most recently from e916e26 to f0f4318 Compare September 14, 2016 17:38
@maleadt
Copy link
Member Author

maleadt commented Sep 14, 2016

No particular need for this on my side either, it just lived in my branch because I need the AlwaysInliner for pulling in CUDA's libdevice, and it seems like a net reduction of code.

I got rid of the support for llvmcalling declarations, which I only added to test the non-inlining case but that test broke after 73b6c3a. It should be much more straightforward now.

@vtjnash What would you replace llvmcall with? Make the user specify whole modules, either by string or by Module*?

@maleadt
Copy link
Member Author

maleadt commented Sep 23, 2016

Rebased, tests are passing. Any final comments?

@maleadt maleadt merged commit 713e995 into master Sep 25, 2016
@maleadt maleadt deleted the tb/always_inline branch September 25, 2016 13:55
@@ -141,6 +142,7 @@ void addOptimizationPasses(PassManager *PM)
// list of passes from vmkit
PM->add(createCFGSimplificationPass()); // Clean up disgusting code
PM->add(createPromoteMemoryToRegisterPass());// Kill useless allocas
PM->add(createAlwaysInlinerPass()); // Respect always_inline
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to have broken build on LLVM 4.0 (not sure about 3.9)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh you fixed it already, thanks.

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