Displaying 2 results from an estimated 2 matches for "107560".
Did you mean:
10750
2010 Jul 04
2
[LLVMdev] Question about SmallVector implementation detail
...void push_back(const T &Elt) {
if (this->EndX < this->CapacityX) {
Retry:
new (this->end()) T(Elt);
this->setEnd(this->end()+1);
return;
}
this->grow();
goto Retry;
}
~/llvm-project/llvm/include/llvm/ADT/SmallVector.h:327 (svn rev: 107560)
This function was wrote/last modified by lattner.
Why a goto?
For CPU branch prediction in favor of the positive condition result?
I'am interested by the reason of that, that's look curious for me.
Thank you,
--
Best regards,
François-Xavier Bourlet
-------------- next part ------------...
2010 Jul 04
0
[LLVMdev] Question about SmallVector implementation detail
...>EndX < this->CapacityX) {
> Retry:
> new (this->end()) T(Elt);
> this->setEnd(this->end()+1);
> return;
> }
> this->grow();
> goto Retry;
> }
>
> ~/llvm-project/llvm/include/llvm/ADT/SmallVector.h:327 (svn rev: 107560)
> This function was wrote/last modified by lattner.
>
> Why a goto?
> For CPU branch prediction in favor of the positive condition result?
> I'am interested by the reason of that, that's look curious for me.
It's a micro-optimization for code layout and code size. The...