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

Migration to the new pass manager in optimization routines #4

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Focshole
Copy link
Contributor

@Focshole Focshole commented Mar 10, 2023

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

@Focshole Focshole changed the title Migration to ORCv2 Migration to the new pass manager in optimization routines Mar 11, 2023
@Focshole Focshole force-pushed the renovation-work branch 2 times, most recently from ad40186 to fc5de1e Compare March 13, 2023 20:27
CMakeLists.txt Outdated Show resolved Hide resolved
Comment on lines 21 to 22
#ifndef LIB_VERSIONING_COMPILER_CLANG_LLVM_TOOLS_OPT_NEWPMDRIVER_H
#define LIB_VERSIONING_COMPILER_CLANG_LLVM_TOOLS_OPT_NEWPMDRIVER_H
Copy link
Owner

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?

Copy link
Owner

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?

Copy link
Contributor Author

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

Copy link
Owner

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'"),
Copy link
Owner

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Owner

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'"),
Copy link
Owner

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Owner

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.

lib/CompilerImpl/JITCompiler.cpp Show resolved Hide resolved
lib/CompilerImpl/JITCompiler.cpp Show resolved Hide resolved
lib/CompilerImpl/JITCompiler.cpp Show resolved Hide resolved
lib/CompilerImpl/JITCompiler.cpp Outdated Show resolved Hide resolved
Comment on lines 614 to 617
// #ifdef VC_DEBUG
// Before executing passes, print the final values of the LLVM options.
llvm::cl::PrintOptionValues();
// #endif
Copy link
Owner

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No clue honestly

Copy link
Owner

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?

Focshole and others added 8 commits August 1, 2023 15:01
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>
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.

None yet

2 participants