Hello,
I have just a little question about the SmallVector implemention.
In SmallVectorImpl, the following method is currently implemented as:
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,