-
Notifications
You must be signed in to change notification settings - Fork 105
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
Return int8Ty instead of i1 when function defined return type bool
#32
Comments
For
yields:
So converting If you're motivated to take a look at this, one warning is that the constraint around the |
Thanks for suggestion.
Using the
And the Clang CodeGen procedure of ConvertTypeForMem() which handles the formmer clangir/clang/lib/CodeGen/CodeGenTypes.cpp Lines 85 to 96 in 6f182fd
So I don't think using the Meanwhile, here are two allocate instructiones in CIR while LLVM IR only one, seems like redundant in some where. |
Yup, that we know is wrong. And you seemed to have found out why by looking at Thank you for pointing this out!
We explicitly always alloc the
I'm not worried about this since it's clearly super trivial for an optimizer to know it can be removed. |
This is actually a bit uglier than I thought. Clang shoehorns the bool to an i8 when it needs it and an i1 otherwise. So our representation has to keep track of what clang decided to do since this is effectively clang-codegen-ABI and we have to agree exactly with the ABI at the LLVMIR level if we want to be able to module link with CodeGen emitted IR files. |
I'm closing this out in favor of #480, since that was more recently updated. |
while trying to add LNot operation, notice that the type converter will make cir.bool translated to i8, I think i1 maybe more proper.
For example:
The text was updated successfully, but these errors were encountered: