-
Notifications
You must be signed in to change notification settings - Fork 382
Bump LLVM #6404
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
Bump LLVM #6404
Conversation
@fabianschuiki @maerhart - needed your help based on @mikeurbach suggestion - getting the following compile errors on the latest bump.
|
I'll drop the |
I've pushed my tweaks. I didn't catch everything yet. There's quite a bit of pointer stuff going on on the LLHD side -- I probably missed a few there. |
Thanks @fabianschuiki looks like CI still failed - should we wait on @maerhart for the rest of the fixes? |
@fabianschuiki @maerhart continuing to see errors - unfortunately seems like lot of onion peeling. Could either of you look into this?
|
Going to do another pass here to get us through the build. |
Fixed all the compilation errors. Things now build properly and then fail in the tests. Most of them are probably just changes in MLIR text output and not actual breakages. Going to take a look at those next. |
We currently don't rely on `llhd-sim` for anything in-tree. The upstream change to `!llvm.ptr` has triggered a lot of churn in the LLHD side of CIRCT. A few breakages remain in the interaction between the llhd-sim runtime and the generated code. These are now gated behind a `REQUIRES: llhd-sim-fixed` in order to unblock the LLVM bump and allow for them to be fixed in parallel.
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.
I've fixed the remaining breakages in the LLHD, HW, and Arc conversions to LLVM. There are still a few runtime breakages in llhd-sim itself, but I've disabled the corresponding tests for now to unblock this LLVM bump. Some of those breakages are likely very subtle and will take some time to track down.
@girishpai You probably want to do a "Squash and Merge" to compress all the small fix commits into one big bump commit, and preserve the PR message as commit message to leave a few breadcrumbs regarding the disabled llhd-sim tests.
Thanks @fabianschuiki - I am seeing some failures in short integration tests - related to Python bindnigs
@mikeurbach any chance its related to your area of expertise? |
Let me take a look at those failures. |
@makslevental do you have any idea about this Python issue? What I'm observing is with the latest LLVM update, the automatic downcasting is not working. I'm wondering if you have any idea what might be wrong since you were poking around in here for the value casters since the last time CIRCT updated LLVM. For example, one of the errors is here:
In this case, Another example is here: circt/integration_test/Bindings/Python/dialects/hw.py Lines 129 to 130 in c65a4af
ModuleType is our own type, and its circt/lib/Bindings/Python/HWModule.cpp Line 75 in c65a4af
Previously, the I looked through recent commits to MLIR, and I don't see anything that was obviously updated here, so I'm curious if you have any ideas. |
I suspect it's this change that's malfunctioning here for you llvm/llvm-project@7c85086#diff-9f49e93375e3ede73d748a7b5f9809da29e96c7f62674cd8b9eaf50181bd17ed, since all of these types and attributes are |
Thanks for taking a look, but I think I've got it. It's actually related to this: llvm/llvm-project@5192e29#diff-1f295ae31d665f9a778ea210c0816a22c621c34d54bf5b83b21686bf0432a918R126. With that change, What do the Attribute and Type I mentioned previously have in common? They're builtin. There is nothing to load, so within I'm pretty sure this is it, with a small patch the automatic downcasting is working again. I'll make a small test case to show the issue and send a PR. |
@girishpai I'm not sure if there's any way to work around this in CIRCT, so let's hold this PR. If I'm on the right track, we might want to wait until the fix is in MLIR and update again. |
What do you mean by "builtin"? I think you mean
If you don't have a dialect (which I know you do) none of the
There is a means and it's described in the same PR but it's only for unregistered dialects so I don't know how it could be something that worked for you previously. |
@makslevental helped me figure this out. The issue I described above was the root cause, but the fix is actually simpler: make sure the builtin dialect actually gets loaded. This is something we can control in CIRCT, and the latest commit fixes this. We're discussing that we probably shouldn't have to do this manually, but for now we can proceed. |
I'm going to go ahead and merge this. No sense in waiting. |
@teqdruid you might not hit the same issue in PyCDE, but I just remembered that you have your own CMake setup there. I didn't update it, but if there is any problem, the short term solution is to apply the last commit on this PR. The longer term solution would be the linked PR. |
Thanks a lot @mikeurbach @fabianschuiki @maerhart for taking care of all the issues promptly!! |
The upstream change to
!llvm.ptr
has triggered a lot of churn in the LLHD side of CIRCT. We currently don't rely onllhd-sim
for anything in-tree. A few breakages remain in the interaction between the llhd-sim runtime and the generated code:test/Dialect/LLHD/Simulator/sim_formats.mlir
test/Dialect/LLHD/Simulator/sim_process.mlir
test/Dialect/LLHD/Simulator/sim_reg.mlir
test/Dialect/LLHD/Simulator/sim_wait.mlir
These are now gated behind a
REQUIRES: llhd-sim-fixed
in order to unblock the LLVM bump and allow for them to be fixed in parallel. We might want to introduce a few intermediate ops in the LLHD dialect to reduce the pretty big abstraction gap between LLHD ops and LLVM. A lot of things can now go through the SCF dialect (and maybe memrefs?).