-
Notifications
You must be signed in to change notification settings - Fork 139
[CIR][ThroughMLIR] Lower structs and GetMemberOp #1565
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
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.
Overall looks good to me. @keryell might have some input here
Looks like some tests are failing |
Seems the failed tests are because of the rename of |
now that I landed your other PR, gh might automatically run the tests, gave it another click! |
Yes you can do that. |
In #1334 I use a tuple-like type to keep the high-level data structure and being able to have for example struct of struct or struct of arrays which have a value semantics which cannot be represented with |
Fails on windows for some reason! |
It seems #1569 calculates wrong offsets for struct types, so the test cases will fail. For a non-packed Still don't know why there's failure on windows though. |
Great!
Seems to be failing all across the board |
To rebase? |
Structs are implemented as `memref<size x i8>`. It is not feasible to represent them as tuples, for tuples can't be put in memref (i.e. pointers to structs would break if we did). We use `memref::ViewOp` for this. Unlike `PtrStrideOp`, the reinterpret cast operation doesn't work here, as the result type is potentially different from i8.
Now the struct offset issue is fixed. |
One alternative is to build your clang with ASAN enabled by the host compiler (using CMAKE's |
Structs are implemented as
memref<size x i8>
. It is not feasible to represent them as tuples, for tuples can't be put in memref (i.e. pointers to structs would break if we did).We use
memref::ViewOp
for this. UnlikePtrStrideOp
, the reinterpret cast operation doesn't work here, as the result type is potentially different from i8.