LLVM21 support#149
Conversation
|
@gast04 Thank you so much for your contribution. We indeed were about to start working on supporting Xcode 26.4. Soon we are going to review your contribution |
|
|
||
| if(OMVLL_ABI STREQUAL "Apple") | ||
| set(LLVM_REQUIRED_VERSION 19.1.4) | ||
| set(LLVM_REQUIRED_VERSION 21.1.8) |
There was a problem hiding this comment.
Since the generated deps are going to be using 21.1.6, we would prefer if LLVM_REQUIRED_VERSION was set to 21.1.6
| @@ -637,7 +637,8 @@ bool StringEncoding::processGlobal(Use &Op, GlobalVariable &G, | |||
| /* no var args */ false); | |||
|
|
|||
| #if LLVM_VERSION_MAJOR > 18 | |||
There was a problem hiding this comment.
| #if LLVM_VERSION_MAJOR > 18 | |
| #if LLVM_VERSION_MAJOR >= 20 |
In theory unnecessary since NDK version is still at 17 but helps us
| return PreservedAnalyses::all(); | ||
|
|
||
| JIT = std::make_unique<Jitter>(M.getTargetTriple()); | ||
| JIT = std::make_unique<Jitter>(M.getTargetTriple().str()); |
There was a problem hiding this comment.
Add a preprocessor conditional so NDK still compiles
| JIT = std::make_unique<Jitter>(M.getTargetTriple().str()); | |
| #if LLVM_VERSION_MAJOR >= 20 | |
| JIT = std::make_unique<Jitter>(M.getTargetTriple().str()); | |
| #else | |
| JIT = std::make_unique<Jitter>(M.getTargetTriple()); | |
| #endif |
| PyConfig &Config = PyConfig::instance(); | ||
| SINFO("[{}] Executing on module {}", name(), M.getName()); | ||
| JIT = std::make_unique<Jitter>(M.getTargetTriple()); | ||
| JIT = std::make_unique<Jitter>(M.getTargetTriple().str()); |
There was a problem hiding this comment.
Add a preprocessor conditional so NDK still compiles
| JIT = std::make_unique<Jitter>(M.getTargetTriple().str()); | |
| #if LLVM_VERSION_MAJOR >= 20 | |
| JIT = std::make_unique<Jitter>(M.getTargetTriple().str()); | |
| #else | |
| JIT = std::make_unique<Jitter>(M.getTargetTriple()); | |
| #endif |
There was a problem hiding this comment.
The file was updated with a new feature (passes to later step). You should add the ThinOrFullLTOPhase for each block and duplicate each with a #if LLVM_VERSION_MAJOR >= 20 so that the previous version still compiles (for the NDK which uses LLVM17)
|
@alexland7219 will do, thanks for the review, true I didn't test the compilation with LLVM 17, my bad |
Not sure if needed but these would be the required API changes for LLVM 21 support, to support Xcode 26.4 and up.
Tested with llvm/llvm-project Tag 21.1.8