Skip to content

Inlining small non-recursive functions #4472

New issue

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

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

Already on GitHub? # to your account

Closed
catamorphism opened this issue Jan 13, 2013 · 3 comments
Closed

Inlining small non-recursive functions #4472

catamorphism opened this issue Jan 13, 2013 · 3 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

Comments

@catamorphism
Copy link
Contributor

I know that inlining heuristics are a black hole. However, it seems that we're growing lots of #[inline_always] attributes on small non-recursive functions. I have no idea what mechanism LLVM has for inlining hints (besides "always inline" annotations on a function), but telling it to always inline non-recursive functions below a certain size threshold would reduce the amount of clutter.

@Aatch
Copy link
Contributor

Aatch commented Jun 7, 2013

LLVM will potentially inline any function. It uses a threshold size for it, which is modified by inlinehint and overridden with always_inline.

@Aatch Aatch closed this as completed Jun 7, 2013
@thestinger
Copy link
Contributor

It can't inline cross-crate though without #[inline] because we aren't usually outputting the AST.

@Aatch
Copy link
Contributor

Aatch commented Jun 7, 2013

@thestinger I'd say thats a separate issue. Either @huonw's #[inline(maybe)] makes it in, or we take a guess at intent and output the ast, sans #[inline] attribute.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Projects
None yet
Development

No branches or pull requests

3 participants