-
Notifications
You must be signed in to change notification settings - Fork 6
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
Migration to the new pass manager in optimization routines #4
base: master
Are you sure you want to change the base?
Conversation
bb78548
to
3c04add
Compare
ad40186
to
fc5de1e
Compare
fc5de1e
to
f8041dd
Compare
#ifndef LIB_VERSIONING_COMPILER_CLANG_LLVM_TOOLS_OPT_NEWPMDRIVER_H | ||
#define LIB_VERSIONING_COMPILER_CLANG_LLVM_TOOLS_OPT_NEWPMDRIVER_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.
Shouldn't this file be a HPP file instead of a H file?
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.
is there a chain of includes that requires this file to stay .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.
I kept it identical to the original file name, so that it can be easily referenced.
https://github.com/llvm/llvm-project/blob/main/llvm/tools/opt/NewPMDriver.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.
Ok, makes sense.
However, please add a comment right near the top to specify this
vc::Option("mem2reg", "-passes='defaultO3,mem2reg'"), | ||
vc::Option("optimization passes", "-passes=","'default<O3>,mem2reg'"), |
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.
this way of writing pass names or pass sets is not of immediate understanding, can you add a comment to mention where default<O3>
is coming from, for example?
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.
Yes, sadly on LLVM they chose this kind of syntax. See https://github.com/llvm/llvm-project/blob/65dca4cbcbfc5c4447207eff7d223005089e9fed/llvm/tools/opt/opt.cpp#L177
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.
Can you find an appropriate point in this file to add a reference to the opt command option guide?
@@ -107,7 +107,7 @@ int main(int argc, char const *argv[]) { | |||
}); | |||
#else | |||
builder.setOptOptions({ | |||
vc::Option("mem2reg", "-passes='defaultO3,mem2reg'"), | |||
vc::Option("optimization passes", "-passes=","'default<O3>,mem2reg'"), |
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.
this way of writing pass names or pass sets is not of immediate understanding, can you add a comment to mention where default<O3>
is coming from, for example?
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.
See #4 (comment)
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.
Same as above, ideally there should be a reference in each test/example file.
include/versioningCompiler/CompilerImpl/ClangLLVM/LLVMInstanceManager.hpp
Outdated
Show resolved
Hide resolved
lib/CompilerImpl/JITCompiler.cpp
Outdated
// #ifdef VC_DEBUG | ||
// Before executing passes, print the final values of the LLVM options. | ||
llvm::cl::PrintOptionValues(); | ||
// #endif |
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.
why is this no longer only enabled in debug mode?
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.
No clue honestly
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.
Can we restore the debug guards?
Co-authored-by: Stefano Cherubin <skeru@users.noreply.github.com>
…Manager.hpp Co-authored-by: Stefano Cherubin <skeru@users.noreply.github.com>
Co-authored-by: Stefano Cherubin <skeru@users.noreply.github.com>
Co-authored-by: Stefano Cherubin <skeru@users.noreply.github.com>
Co-authored-by: Stefano Cherubin <skeru@users.noreply.github.com>
Co-authored-by: Stefano Cherubin <skeru@users.noreply.github.com>
Co-authored-by: Stefano Cherubin <skeru@users.noreply.github.com>
It is based on the previous work to port to LLVM15. It finally does the migration to the new pass manager in a maintainable way (edits from original LLVM files are highlighted). It is thought for LLVM 16