-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[DRAFT] "Builtins world" for LTO #164916
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
Draft
mysterymath
wants to merge
7
commits into
llvm:main
Choose a base branch
from
mysterymath:builtins-world-full
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[DRAFT] "Builtins world" for LTO #164916
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions h,cpp -- lld/ELF/Driver.cpp lld/ELF/LTO.cpp lld/ELF/LTO.h llvm/include/llvm/LTO/LTO.h llvm/include/llvm/LTO/LTOBackend.h llvm/lib/LTO/LTO.cpp llvm/lib/LTO/LTOBackend.cpp llvm/lib/LTO/LTOCodeGenerator.cpp llvm/lib/Object/IRSymtab.cpp --diff_from_common_commit
View the diff from clang-format here.diff --git a/llvm/include/llvm/LTO/LTO.h b/llvm/include/llvm/LTO/LTO.h
index d0a447df6..f128193f9 100644
--- a/llvm/include/llvm/LTO/LTO.h
+++ b/llvm/include/llvm/LTO/LTO.h
@@ -402,7 +402,8 @@ public:
LLVM_ABI Error add(std::unique_ptr<InputFile> Obj,
ArrayRef<SymbolResolution> Res);
- LLVM_ABI void setBitcodeLibFuncs(const SmallVector<const char *> &BitcodeLibFuncs);
+ LLVM_ABI void
+ setBitcodeLibFuncs(const SmallVector<const char *> &BitcodeLibFuncs);
/// Returns an upper bound on the number of tasks that the client may expect.
/// This may only be called after all IR object files have been added. For a
diff --git a/llvm/include/llvm/LTO/LTOBackend.h b/llvm/include/llvm/LTO/LTOBackend.h
index 26bff2281..2e5334740 100644
--- a/llvm/include/llvm/LTO/LTOBackend.h
+++ b/llvm/include/llvm/LTO/LTOBackend.h
@@ -40,7 +40,7 @@ LLVM_ABI bool opt(const Config &Conf, TargetMachine *TM, unsigned Task,
ModuleSummaryIndex *ExportSummary,
const ModuleSummaryIndex *ImportSummary,
const std::vector<uint8_t> &CmdArgs,
- const SmallVector<const char*>& BitcodeLibFuncs);
+ const SmallVector<const char *> &BitcodeLibFuncs);
/// Runs a regular LTO backend. The regular LTO backend can also act as the
/// regular LTO phase of ThinLTO, which may need to access the combined index.
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 95f061036..fe1550324 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1503,7 +1503,7 @@ public:
class InProcessThinBackend : public CGThinBackend {
protected:
FileCache Cache;
- const SmallVector<const char*> &BitcodeLibFuncs;
+ const SmallVector<const char *> &BitcodeLibFuncs;
public:
InProcessThinBackend(
|
6a135ef to
ca68c17
Compare
- Preserve all libc symbols in LTO - Disable libfuncs that aren't present in the module This is overly-disably: - Libfuncs not in bitcode are disabled too - Libfuncs defined in other ThinLTO modules are disabled unless they are imported into the module. Not sure when importing happens; maybe that means this disables all libfuncs for ThinLTO entirely?
ca68c17 to
33aa80b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A crummy draft patch to demonstrate how LTO can be altered to treat builtin libfuncs with more respect after LTO symbol resolution