Ultra concise and incredibly useful. Happy to stumble upon that :)
@mockingbird38093 жыл бұрын
Very useful talk learned a lot about x86 asm too. Thanks for those quick overview of the x86 basics on call/return :)
@CppCon3 жыл бұрын
Glad it was helpful!
@xealit3 ай бұрын
16:00 the return IPF64(IPF32&&); - why does it work in this case? The type of the first parameter is not IPF64 here either. - Ah! wait, the constructors are templated, and there is a IPF64(IPF32&&). Did not notice that. And I thought you'd have to make it use the move before: IPF64 result = get_upstream_callback(); return result; And it is the same to use IPF32::operator IPF64 probably.
@dirtbikersteve6 жыл бұрын
3:00 rdi movs to rax so that once return slot is filled that by convention the return register (rax/eax) holds this pointer to return slot.
@MatthijsvanDuin6 жыл бұрын
That part is completely obvious, at the very least to the speaker (given his experience working on compilers). The big question is why this convention exists. It has no obvious utility and no such convention exists e.g. on ARM or PowerPC.
@dennydaydreamer2 жыл бұрын
For the Cexpr example, if there exists a constructor Cexpr(CexprList&&) that does the slicing by moving, would it have been called?
@shahmiBro16 жыл бұрын
Durian is not a problem, it just a matter of an individual's taste;
@notnullnotvoid6 жыл бұрын
This kind of insanity is why plain old C is still alive and well.
@VioletGiraffe5 жыл бұрын
And also why it sucks.
@bobweiram6321 Жыл бұрын
Ada is the way.
@dingliu52733 жыл бұрын
Brilliant talk, I love it!
@zhivkobogdanov28453 жыл бұрын
It's worth mentioning that copy elision will not be performed, as far as I am aware, if you have multiple return points or some initialization that follows a certain condition. Try to avoid those. :-)
@axelBr1 Жыл бұрын
I believe the following will work (i.e. not create a copy), but uses a Move. If a is made const it might work, (i.e. not make a copy) A foo() { if ( condition ) { A a = …; … return a; } else { A a = …; … return a; } };
@isitanos4 жыл бұрын
Not convinced by the example at p.32. It might be impossible to optimize based on a limited view of only the current function, but if the parameter passed is a temporary, it should be possible to keep collapsing until you have only one memory location left.
@Xeverous6 жыл бұрын
In many cases, compilers were better than the standard - but isn't this actually allowed? Can the perform RVO better than the standard says because of the as-if rule?
@MatthijsvanDuin6 жыл бұрын
All the headache here is related to classes with user-defined copy and/or move constructors, in which case copy elision (including RVO) and implicit move are semantic changes that do not fall under the as-if rule and therefore require explicit permission from the standard.
@JohnDlugosz5 жыл бұрын
The description is wrong. "he'll walk through the relatively painless process of creating that diagnostic, and perhaps inspire you to contribute to Clang yourself!" is not included here. This is a shortened version of the presentation.
@yuehuajia31766 жыл бұрын
good talk.
@User-cv4ee Жыл бұрын
Man this is waaaayy too complicated. I can wrap my head (maybe?) around some of these snippets but on a production code..not really sure. Great presentation btw. You tried your best but the topic is just too complicated.
@GeorgeTsiros6 жыл бұрын
uuhm aaah aaahm I would have walked out in the first minute. Learn to speak.
@vivekveer3272 Жыл бұрын
who hurt you dude? a bit of stuttering is fine, much better than a robotic presentation. The content was good too.