-
Notifications
You must be signed in to change notification settings - Fork 104
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
[CIR] Remove the !cir.void return type for functions returning void #1203
Conversation
C/C++ functions returning void had an explicit !cir.void return type while not having any returned value, which was breaking a lot of MLIR invariants when the CIR dialect is used in a greater context, for example with the inliner. Now, a C/C++ function returning void has not return type and no return values, which does not break the MLIR invariant about the same number of return types and returned values. This change keeps the same parsing/pretty-printed syntax as before for compatibility.
The last failure was masked by the usual noise of 18 failures on my laptop:
with |
What failure messages do you see, and what platform are you on? I run all tests on Linux with that configuration regularly without issues (using Clang as my host compiler). |
Ubuntu 24.10 g++14.2 & its C++ lib, Clang20 of the day.
|
A reason is probably that at Meta you use an old lib C++ without the latest cute new floating-point formats. |
Ah, I've seen those before, and they're caused by The setup still seems kinda fragile overall though, and I ended up switching to |
Amazing, I cherry-picked this and it solved my issues!!! 🤯 All the tests are passing now. Go for it. 🚀
I have no opinion on this. I probably picked these options because of our downstream projects using Clang/LLVM/MLIR libraries. |
I put up #1222. I'd recommend trying out |
@lanza @bcardosolopes Any feedback about this? |
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.
Thanks for taking the extra length and making the parser flexible enough to support multiple ways to deal with void, yay!
@bcardosolopes Related to the discussion in llvm/llvm-project#120484 (comment), this PR was about fixing the MLIR invariant while keeping exactly the same text representation. It showed that it works and makes some basic MLIR transformations to work. |
C/C++ functions returning void had an explicit !cir.void return type while not having any returned value, which was breaking a lot of MLIR invariants when the CIR dialect is used in a greater context, for example with the inliner. Now, a C/C++ function returning void has not return type and no return values, which does not break the MLIR invariant about the same number of return types and returned values.
This change keeps the same parsing/pretty-printed syntax as before for compatibility.