-
Notifications
You must be signed in to change notification settings - Fork 31
Upgrade CppInterOp to support llvm 20 #491
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #491 +/- ##
=======================================
Coverage 76.16% 76.16%
=======================================
Files 9 9
Lines 3655 3655
=======================================
Hits 2784 2784
Misses 871 871
🚀 New features to boost your workflow:
|
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.
clang-tidy made some suggestions
@@ -174,13 +174,15 @@ void CopyIncludePaths(const clang::HeaderSearchOptions& Opts, | |||
if (!withSystem) continue; | |||
if (withFlags) incpaths.push_back("-isystem"); | |||
break; | |||
|
|||
//option doesn't appear to exist for llvm>19. Will revert if I determine otherwise. | |||
#if CLANG_VERSION_MAJOR < 20 |
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.
warning: no header providing "CLANG_VERSION_MAJOR" is directly included [misc-include-cleaner]
lib/Interpreter/Paths.cpp:20:
+ #include <clang/Basic/Version.h>
c8a5a4d
to
e435205
Compare
e435205
to
391be18
Compare
f04cc0f
to
699c6d7
Compare
I get these warnings while building latest llvm
Possibly should be fixed in our llvm build too ! |
Thanks. Will look into this. Need to see if this option is avilable on older versions of llvm, given the ci covers multiple versions. |
ba50742
to
889f996
Compare
Hi, Just curious as to what work is left here (as llvm 20.0.1 was released last week) ? |
@anutosh491 This PR is simply waiting for review and approval. I wasn't expecting the release last week, so that is why I didn't request a review yet (I thought it was this week). I only just realised it got released today. The reason its only covering non-wasm is because I can't get an Emscripten build of llvm 20 to work. I was planning to ask if you had had any luck compiling. @vgvassilev can you review this PR? |
Yeah someone else told me too that getting an emscripten build for llvm is tough. I haven't tried it yet and shall give it an attempt! Edit: out of curiosity, I guess it makes sense to keep the latest possible plvm versions used for wasm and non-wasm the same. Does it ? I'll try to get a working wasm build with llvm 20 asap if that's case (I didn't realise it was this tough) |
Hi @mcbarton I was trying to get a wasm build for latest upstream llvm this morning and these were the only two things I found concerning.
Can also be seen here through my build on emscripten-forge. Now this was happening because we weren't defining LLVM_ABI correctly when building against emscripten. If you see llvm/Support/Compiler.h, the condition only checked for the platform
So we should be good to have a wasm build for llvm. The build was successful and I also tried it with my pet project |
unittests/CppInterOp/CUDATest.cpp
Outdated
@@ -54,7 +57,12 @@ TEST(CUDATest, Sanity) { | |||
EXPECT_TRUE(Cpp::CreateInterpreter({}, {"--cuda"})); | |||
} | |||
|
|||
#if CLANG_VERSION_MAJOR == 20 | |||
// FIXME: CUDA Tests Broken for llvm 20 release/ | |||
TEST(DISABLED_CUDATest, CUDAH) { |
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.
We should probably figure out what's going on here before moving forward.
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.
@vgvassilev This is the error with the CudaTests trying to run with an llvm 20 build https://github.com/compiler-research/CppInterOp/actions/runs/13820931151/job/38668593188?pr=491#step:10:187 . Any ideas about what is going on, or how to fix it?
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.
@anutosh491 @aaronj0 @Vipul-Cariappa any ideas about what is happening to cause the above error message in the native build, or how to debug it?
With respect to this Both my PRs required to for building latest llvm against emscripten were merged. I had added one as a patch on emscripten-forge but that's merged too, so hopefully we should be fine after the next release (this one llvm/llvm-project#131578) So hopefully moving for llvm 20 for the emscripten use case isn't an issue now ;) |
@anutosh491 Your cherry pick command in the llvm PR failed (see llvm/llvm-project#131578 (comment) ). You may need to try again. |
Hey @vgvassilev could you help us here by applying the required milestone on the PR so that the cherry pick passes ? |
Hey @mcbarton I was interested in knowing if you were able to figure out what blocks this PR ? Asking this cause llvm 20.1.2 was out today (llvm 20 being out quite some time ago) and would be great if we could make the move soon and also probably a release supporting latest llvm too. |
Hi @anutosh491 With the changes you've made to llvm I plan to make this PR add jobs for both native and Emscripten llvm 20 cases. The only blocker for this PR is the error mentioned in this comment #491 (comment) . Any ideas what is going on? |
Hmm, can give it a look as I find time. |
While investigating the failing CUDA test locally I noticed the following. If I run clang-repl version 19 and 20 locally on MacOS I get (obviously not expecting to work given MacOS doesn't support Nvidia gpus, but it is interesting to note that version 20 crashes with a segmentation fault with the CUDA flag)
Running clang-repl version 20 with the cuda flag on Ubuntu also has a segmentation fault I absolutely could be wrong, but this at least to me suggests that fixing the test may require a change in llvm. I'm not well versed on how llvm is handling anything related to cuda. @vgvassilev can you provide me with some insight, or cc someone who may be able to help? |
Description
Please include a summary of changes, motivation and context for this PR.
Given the llvm 20.x branch got released today I can begin the upgrade to CppInterOp to support llvm 20.
Fixes # (issue)
Type of change
Please tick all options which are relevant.
Testing
Please describe the test(s) that you added and ran to verify your changes.
Checklist