-
-
Notifications
You must be signed in to change notification settings - Fork 273
[LLVM22] Add test case for lifetime.start not appearing with sret
#5022
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: master
Are you sure you want to change the base?
[LLVM22] Add test case for lifetime.start not appearing with sret
#5022
Conversation
|
Hmm @kinke I think your fix #5015 was either wrong for old LLVM versions or it was already broken for old LLVM versions. |
|
add |
I very much doubt so - we surely have many many RVO cases as part of the testsuite. I'm not sure an extra test case (for NRVO and RVO) for these lifetime annotations are required. I mean you seem to have hit it quite immediately with LLVM master, without extra test case. And if you really want to cover this LLVM 22 limitation to allocas, you don't really have to check for elided lifetime annotations either - we'd most likely get LLVM errors/assertions [edit: well, before #5015] as soon as there are (N)RVO cases in an existing |
|
What I'd find more interesting test-wise is the handling of non-in-place-constructed temporaries. I suspect we don't declare their lifetime end at the end of the statement; and these temporaries could account for higher-than-needed stack pressure, perhaps/probably more than regular locals. |
Well these tests fail on old LLVMs so... |
|
The actual problem is this: extern(C): // this!
struct S {
this(this) {}
}
S sretReturn_NRVO() {
S ret;
return ret;
}
S sretReturn_RVO() {
return S();
}This last compiled with LDC v1.27.1 according to godbolt, v1.28.1 already failed. The problem is that with As C doesn't have non-PODs but the frontend happily accepts such signatures apparently, we'll probably have to deal with such non-POD return types as we do for |
|
Do we really need |
No description provided.