Repository navigation
Provide an easy way to use LLVM's Polly #39884
Description
Activity
- addedA-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
on May 23, 2017 - addedC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.and removed
on Jul 27, 2017 Hi, it seems I can simply checkout https://github.com/llvm-mirror/polly into src/llvm/tools/polly, checkout the release_60 branch and llvms cmake will do the rest of the configuration.
I rebuilt rust and was able to build a program with RUSTFLAGS="-C passes=polly,polly-parallel" for example. :)Reacted by kennytm and gnzlbgCould we build with it by default?
Reacted by Kerem KatI tried adding to the rust repos .gitmodules as a submodule however this did not work, probably because it would check out not into the root repo but rather into the directory of another submodule (llvm).
What is the best to handle this?
Add it as submodule of the llvm repo or add it to the llvm/tools/polly "manually" via some custom command in some build script?This isn't as straight forward as suggested. After cloning the polly repo into
src/llvm/tools, the passes won't be available: you'll have to modify thelibrustc_llvmbuild script to addPollyandPollyISLto the link. Next, you'll need to modifiyrustllvmby initializing the polly passes into the llvm pass registry by callingpolly::initializePollyPassesinLLVMInitializePasses, and lastly callingpolly::registerPollyPassesinLLVMRustAddAnalysisPasses(probably not the best spot to do this, but required the fewest changes).BTW there is an ongoing discussion in the LLVM community about moving Polly into LLVM proper, using its infrastructure in existing and new loop optimizations, and slowly moving at least some of Polly's capabilities into the default optimization pipeline. See here for example. This is a project that will take a long time to fully come to fruition but the end result will not just be easier to use from rustc, it will hopefully also result in better and more general optimizations overall.
Reacted by LifeIsStrange, Bernardo Meurer and Corallus CaninusReacted by LifeIsStrangeTriage: #51061 exists 🎊
- changed the title
[-]Provide an easy way to use llvm's polly[/-][+]Provide an easy way to use LLVM's Polly[/+]on Jan 15, 2019 #78566 allows polly to be passed into llvm-args. It is not available by default on nightly, and to use the pass, one must currently build rustc with polly enabled.
- addedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Apr 5, 2023
To use polly with clang I just need to compile polly together with llvm and clang (just check it out and put it in the correct directory before compiling), load it as a clang plugin, and then enable
-mllvm polly.It would be nice if:
/lib/LLVMPolly.soas a plugin-mllvm polly.-mllvm -polly-option_name=valuedance over and over again.This would allow to start experimenting with polly, to e.g. make sure that it gets proper aliasing information for Rust.