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

Make some code easier to inline (rebased) #1105

Merged
merged 13 commits into from
Jul 29, 2024
Merged

Make some code easier to inline (rebased) #1105

merged 13 commits into from
Jul 29, 2024

Conversation

dwightguth
Copy link
Collaborator

The llvm backend was not being particularly intelligent about the ability to inline certain function calls. Here we move all the .ll files in the runtime directory into the module used to initialize code generation. This allows these calls to live in one translation unit and be better optimized, while also simplifying llvm-kompile-clang.

@rv-jenkins rv-jenkins changed the base branch from master to develop July 9, 2024 18:21
Dwight Guth added 10 commits July 10, 2024 06:03
This is needed because previously we handled these with weak symbols,
but the linker can no longer do this for us because everything is now in
the same translation unit. Therefore, we reset these functions so that
they no longer contain their "default" implementations when they get
created by the compiler.
Comment on lines -185 to -210
if $link; then
for file in "$LIBDIR"/llvm/*.ll; do
tmp="$tmpdir/$(basename "$file").o"
if $visibility_hidden; then
tmphidden="$tmpdir/$(basename "$file").hidden.bc"
run @OPT@ "$file" -load-pass-plugin "$set_visibility_hidden" -set-visibility-hidden -o "$tmphidden"
file="$tmphidden"
fi
run @LLC@ \
"$file" -mtriple=@BACKEND_TARGET_TRIPLE@ \
-filetype=obj "$llc_opt_flags" "${llc_flags[@]}" -o "$tmp"
files+=("$tmp")
done
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

config/llvm_header.h Outdated Show resolved Hide resolved
Comment on lines 30 to 32
return
#include "config/llvm_header.h"
;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't know that this was possible! Awesome!

Copy link
Collaborator

@Robertorosmaninho Robertorosmaninho left a comment

Choose a reason for hiding this comment

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

LGTM. Just interested in the answer for the the question in Decision.cpp. Feel free to merge after double-checking it!

@dwightguth dwightguth enabled auto-merge (squash) July 29, 2024 15:58
@dwightguth dwightguth merged commit 8e55383 into develop Jul 29, 2024
10 checks passed
@dwightguth dwightguth deleted the inline3 branch July 29, 2024 16:25
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