-
Notifications
You must be signed in to change notification settings - Fork 102
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
Update __rust_{alloc,realloc} builtins #89
Update __rust_{alloc,realloc} builtins #89
Conversation
The prototypes for these alloc functions changed in library/alloc and need updating here.
The zulip thread mentions that after this change one test no longer optimizes. Is that still the case, or was that with an earlier version? |
Hi @nikic the suite passes fine with these changes. That was user error! When I was working on these changes, I'd inadvertently reordered the builtins, and there is an invariant that these must be defined in alphabetical order -- something I missed as I'd compiled LLVM without assertions 🤦 |
I've looked into why this works despite the incorrect checks, and it turns out that getAllocationDataForFunction is using the getLibFunc API that only checks the function name, and then performs it's own signature checks. And the parameter counts specified in MemoryBuiltins were correct. As such, the libcall detection logic ultimately didn't matter. Possibly it makes sense to just drop these checks entirely, if they're going to be ignored anyway? Though we could also add some additional FuncAttrs inference, in particular adding |
That's interesting, and explains a lot. I'm happy to remove these checks entirely if you'd prefer.
IIUC |
Right. For reference, this happens here: I guess if we wanted to add more attributes, it would make sense to do so there as well, no point in doing it on the LLVM side really. I think in that case it would be best to just drop this code. |
Do you mean close the PR? Or remove the rust alloc functions from the |
I mean remove the signature checks in |
Something like this 40d6804? |
Due to changes in LLVM 13 these checks actually matter now, so I've included the original version of this PR as part of the rebase (b1f55f7 is the new commit). |
89: Serialise alloca properly. r=ltratt a=vext01 Co-authored-by: Edd Barrett <[email protected]>
This PR adds support for thread names in lldb on Windows. ``` (lldb) thr list Process 2960 stopped thread rust-lang#53: tid = 0x03a0, 0x00007ff84582db34 ntdll.dll`NtWaitForMultipleObjects + 20 thread rust-lang#29: tid = 0x04ec, 0x00007ff845830a14 ntdll.dll`NtWaitForAlertByThreadId + 20, name = 'SPUW.6' thread rust-lang#89: tid = 0x057c, 0x00007ff845830a14 ntdll.dll`NtWaitForAlertByThreadId + 20, name = 'PPU[0x1000019] physics[main]' thread rust-lang#3: tid = 0x0648, 0x00007ff843c2cafe combase.dll`InternalDoATClassCreate + 39518 thread rust-lang#93: tid = 0x0688, 0x00007ff845830a14 ntdll.dll`NtWaitForAlertByThreadId + 20, name = 'PPU[0x100501d] uMovie::StreamingThread' thread #1: tid = 0x087c, 0x00007ff842e7a104 win32u.dll`NtUserMsgWaitForMultipleObjectsEx + 20 thread rust-lang#96: tid = 0x0890, 0x00007ff845830a14 ntdll.dll`NtWaitForAlertByThreadId + 20, name = 'PPU[0x1002020] HLE Video Decoder' <...> ```
The prototypes for these alloc functions changed in library/alloc and need updating here.
Uncovered as part of zulip discussion here.