Skip to content

Conversation

@wenyongh
Copy link
Contributor

Use LLVM new pass manager for wamrc to replace the legacy pass manger,
so as gain better performance and reduce the compilation time.
Reference links:

And add an option to use the old legacy pm mode when building wamrc:
cmake .. -DWAMR_BUILD_LLVM_LEGACY_PM=1

For JIT mode, keep unchanged as it only runs several function passes and using
new pass manager will increase the compilation time.

And refactor the codes of applying LLVM passes.

@no1wudi
Copy link
Collaborator

no1wudi commented Jan 21, 2022

And add an option to use the old legacy pm mode when building wamrc: cmake .. -DWAMR_BUILD_LLVM_LEGACY_PM=1

Why keep this option ? It does'n make sense to wamrc's user if it's works fine.
And it wouldn't introduce potential compatibility issues ?

@wenyongh
Copy link
Contributor Author

And add an option to use the old legacy pm mode when building wamrc: cmake .. -DWAMR_BUILD_LLVM_LEGACY_PM=1

Why keep this option ? It does'n make sense to wamrc's user if it's works fine. And it wouldn't introduce potential compatibility issues ?

Just to keep an option for user to tune the performance, for most cases, the performance of llvm new pass manager is better, but for some cases, it may be not as good as before. The original mode applies some function passes, vector related passes and lto passes, the performance is also relatively good, but the compilation time is really long.
Seems that the original APIs are also available, and there should be no compatibility issue currently, at least we can use them in some time. If the LLVM new version doesn't support it, we should be able to use the llvm version macro (e.g. LLVM_VERSION_MAJOR) to control the code.

@wenyongh wenyongh merged commit 5631a2a into main Jan 24, 2022
xujuntwt95329 pushed a commit to xujuntwt95329/wasm-micro-runtime that referenced this pull request Jan 24, 2022
Use LLVM new pass manager for wamrc to replace the legacy pass manger,
so as to gain better performance and reduce the compilation time.
Reference links:
- https://llvm.org/docs/NewPassManager.html
- https://blog.llvm.org/posts/2021-03-26-the-new-pass-manager

And add an option to use the legacy pm mode when building wamrc:
cmake .. -DWAMR_BUILD_LLVM_LEGACY_PM=1

For JIT mode, keep it unchanged as it only runs several function passes and
using new pass manager will increase the compilation time.

And refactor the codes of applying LLVM passes.
@wenyongh wenyongh deleted the dev/use_llvm_new_pm branch January 25, 2022 12:24
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Use LLVM new pass manager for wamrc to replace the legacy pass manger,
so as to gain better performance and reduce the compilation time.
Reference links:
- https://llvm.org/docs/NewPassManager.html
- https://blog.llvm.org/posts/2021-03-26-the-new-pass-manager

And add an option to use the legacy pm mode when building wamrc:
cmake .. -DWAMR_BUILD_LLVM_LEGACY_PM=1

For JIT mode, keep it unchanged as it only runs several function passes and
using new pass manager will increase the compilation time.

And refactor the codes of applying LLVM passes.
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.

2 participants