-
Notifications
You must be signed in to change notification settings - Fork 162
[CIR][ABI] Add X86_64 float and double CC lowering #714
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][ABI] Add X86_64 float and double CC lowering #714
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.
LGTM!
Good to merge when the tests get fixed. From the bots, looks like it's triggering an assert:
|
95c6122
to
8abc5a5
Compare
@bcardosolopes I'll be running the x86_64/AArch64 CC lowering tests only when the ClangIR build is for Ubuntu. Windows and Darwin each have different behaviors and are throwing different issues. Setting up a dev environment for all three platforms would take too much time. |
Unfortunately that's not acceptable, you should look at OG codegen tests and figure out what silly thing is missing, it's subtle but shouldn't be complicated - the host shouldn't affect codegen for the target. |
Let me try this locally on macOS and see if I can repro for you |
I can reproduce it, let me debug it and get back to you |
Ok, couple of different things going on. On a release build:
However, on a debug build, it crashes a bit before as part of MergeCleanups:
It happens while trying to dump the root op in Bisecting the tests a bit, I can see the crash it only triggers for 3 of them: |
Bool before conversion:
Bool after (as of crash state):
However, looking at |
Reverting that commit now gets me to the actual crash, so it wasn't related at all. Anyways, let me look into the real one now :) |
Ok, back to the actual issue. For the double example:
My guess is that you are missing some initialization bits for |
I think the logic of RemoveRedundantBranches doesn't seem suitable to be implemented in fold (or there might be an issue with my implementation), because when deleting operations in fold, it falls into the loop I described earlier. #690 (comment).
I am also responsible for this error, as I failed to identify the potential issues. However, I have been a bit busy lately. When I have some free time, I will try to address the previous unresolved issues. |
Yea, I was thinking it could be related to that, but at that point I missed the invariants about fold.
I think for these we could leverage the existing passes that take advantage of
It's all good, thanks for the fast response, and your contribs are always welcome! |
00ce2d7
to
7b9c005
Compare
Seems like it passes macOS now, yay! There's a remaining failure on windows still: Type T1 = {};
unsigned T0Size = TD.getTypeAllocSize(T0);
if (SourceSize > T0Size)
llvm_unreachable("NYI"); |
The dangling ref guess was spot on 🔥
I'm trying to set up a WS2019 VM to debug this. Fixing it without being able to reproduce it is not very practical. |
Yep. Alternative approaches I suggest: build a ASANified clang and run the test with it, if it's still related to dangling stuff, it might catch it on linux as well - I have used that sometimes for these types of issues. Something else to keep an eye on is that for x86_64, windows inherits from the more generic target info and adds some stuff, it's possible some slicing is happening. |
7b9c005
to
63730b5
Compare
Implements calling convention lowering of float and double arguments and return values conventions for X86_64.
63730b5
to
bbb45d2
Compare
Implements calling convention lowering of float and double arguments and return values conventions for X86_64.
Implements calling convention lowering of float and double arguments and return values conventions for X86_64.
Implements calling convention lowering of float and double arguments and return values conventions for X86_64.
Implements calling convention lowering of float and double arguments and return values conventions for X86_64.
Implements calling convention lowering of float and double arguments and return values conventions for X86_64.
Implements calling convention lowering of float and double arguments and return values conventions for X86_64.
Implements calling convention lowering of float and double arguments and return values conventions for X86_64.