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

[ORC] Unify symbol mapping and allow custom mapping functions #79616

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lucasreis1
Copy link

This PR provides four changes:

  1. Unify symbol mapping into IRLayer and discard the old IRSymbolMapper
    class
  2. Allow clients to provide their symbol mapper function to
    provide custom mappings
  3. Skip adding linkonce_odr symbols to the symbol map on the default
    mapper (fixes [ORC] Missing definition for inlining function after optimizations in IRTRansformLayer  #64907)
  4. Create a small FAQ section to explain to users why their LLVM IR symbol might be missing a definition from the JIT as a result of change 3.

This commit makes three changes:
1. Unify symbol mapping into IRLayer and discard the old IRSymbolMapper
   class
2. Allow for clients to provide their own symbol mapper function to
   provide custom mappings
3. Skip adding linkonce_odr symbols to the symbol map on the default
   mapper (fixes llvm#64907)
Populate a small FAQ section with its first question related to missing symbols from IR to prepare for the new changes to symbol mapping
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

Copy link

github-actions bot commented Jan 26, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 0f339e6567bffb290e409ef5de272fb75ce70234 5a2bbeb4c8b25d13da9aac729f40a4a5d4b491ec -- llvm/include/llvm/ExecutionEngine/Orc/Layer.h llvm/include/llvm/ExecutionEngine/Orc/Mangling.h llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp llvm/lib/ExecutionEngine/Orc/Layer.cpp llvm/lib/ExecutionEngine/Orc/Mangling.cpp
View the diff from clang-format here.
diff --git a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
index 007e19a8f87..73e927fd141 100644
--- a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/ADT/Hashing.h"
 #include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
+#include "llvm/ADT/Hashing.h"
 #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
 #include "llvm/IR/Mangler.h"
 #include "llvm/IR/Module.h"

1. Move symbol mapping logic from IRLayer to IRSymbolMapper
2. Use the same logic between all know structures that require mapping
@lucasreis1
Copy link
Author

@lhames

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.

[ORC] Missing definition for inlining function after optimizations in IRTRansformLayer
1 participant