-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: use llvm new pass manager api #352
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #352 +/- ##
==========================================
- Coverage 85.82% 85.79% -0.03%
==========================================
Files 108 108
Lines 23987 23983 -4
==========================================
- Hits 20587 20577 -10
- Misses 3400 3406 +6
|
Benchmark for 45b6b7eClick to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, could add some comments for the cpp functions
let mpm: inkwell::passes::PassManager<Module> = | ||
unsafe { inkwell::passes::PassManager::new(ptr) }; | ||
|
||
// let ptr = unsafe { llvm_sys::core::LLVMCreatePassManager() }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused comments.
#include "llvm-c/Transforms/PassBuilder.h" | ||
|
||
// param: opt opt level | ||
extern "C" void run_module_pass(LLVMModuleRef M, int opt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could add a comment about run_module_pass
to explain:
- what does this function do
- which llvm API it calls(add a llvm link if possible)
- the mapping between optimization level and integer.
immix/llvm/plimmix.cpp
Outdated
@@ -30,9 +30,68 @@ extern "C" void LLVMLinkPLImmixGC() | |||
#include "llvm-c/Transforms/PassManagerBuilder.h" | |||
|
|||
extern "C" void add_module_pass(llvm::legacy::PassManagerBase * PB) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extern "C" void add_module_pass(llvm::legacy::PassManagerBase * PB) { | |
extern "C" void add_module_pass(llvm::legacy::PassManagerBase *PB) { |
immix/llvm/plimmix.cpp
Outdated
#include "llvm/Passes/PassBuilder.h" | ||
#include "llvm/Passes/PassPlugin.h" | ||
|
||
#include "llvm-c/Types.h" | ||
#include "llvm-c/Transforms/PassBuilder.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we put all files at the top of this file?
// [](const llvm::PassManagerBuilder &Builder, | ||
// llvm::legacy::PassManagerBase &PM) | ||
// { PM.add(new Immix()); }); | ||
// char ImmixPass::ID = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused comment
{ | ||
for (auto FB = M.functions().begin(), FE = M.functions().end(); FB != FE; ++FB) | ||
{ | ||
Function *FV = &*FB; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, why not use FB
directly
Benchmark for 98a8e28Click to view benchmark
|
No description provided.