search for: nextpowerof2

Displaying 8 results from an estimated 8 matches for "nextpowerof2".

2014 May 12
2
[LLVMdev] Build failure with libcxx
...May 11, 2014 at 10:19 PM, İsmail Dönmez <ismail at donmez.ws> wrote: > I did a diff -u broken.ii working.ii and the difference explains the > problem: > > @@ -36617,7 +36628,7 @@ > } x; > }; > return Allocator.Allocate( > - Size, std::min((size_t)llvm::NextPowerOf2(Size), offsetof(S, x))); > + Size, std::min((size_t)llvm::NextPowerOf2(Size), > __builtin_offsetof(S, x))); > } > > > Looks like non-working clang is using offsetof where-as the working one > uses __builtin_offsetof > > > > On Fri, May 9, 2014 at 11:38 AM, İsm...
2014 May 09
2
[LLVMdev] Build failure with libcxx
...o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/Allocator.cpp.o -c ../lib/Support/Allocator.cpp [ 723s] In file included from ../lib/Support/Allocator.cpp:14: [ 723s] ../include/llvm/Support/Allocator.h:421:65: error: 'S' does not refer to a value [ 723s] Size, std::min((size_t)llvm::NextPowerOf2(Size), offsetof(S, x))); [ 723s] ^ [ 723s] ../include/llvm/Support/Allocator.h:411:10: note: declared here [ 723s] struct S { [ 723s] ^ [ 723s] 1 error generated. clang r207403 is OK but trunk fails. Any ideas for debu...
2013 Aug 13
1
[LLVMdev] vector type legalization
...eger()) { // Vectors with a number of elements that is not a power of two are always - // widened, for example <3 x float> -> <4 x float>. + // widened, for example <3 x i8> -> <4 x i8>. if (!VT.isPow2VectorType()) { NumElts = (unsigned)NextPowerOf2(NumElts); EVT NVT = EVT::getVectorVT(Context, EltVT, NumElts); + while (!isTypeLegal(NVT)) { + NumElts = (unsigned)NextPowerOf2(NumElts); + NVT = EVT::getVectorVT(Context, EltVT, NumElts); + } return LegalizeKind(TypeWidenVector, NVT); } Fr...
2013 Aug 13
0
[LLVMdev] vector type legalization
...Vectors with a number of elements that is not a power of two are always > - // widened, for example <3 x float> -> <4 x float>. > + // widened, for example <3 x i8> -> <4 x i8>. > if (!VT.isPow2VectorType()) { > NumElts = (unsigned)NextPowerOf2(NumElts); > EVT NVT = EVT::getVectorVT(Context, EltVT, NumElts); > + while (!isTypeLegal(NVT)) { > + NumElts = (unsigned)NextPowerOf2(NumElts); > + NVT = EVT::getVectorVT(Context, EltVT, NumElts); > + } > return LegalizeKind(TypeWi...
2015 Apr 20
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
Sean, thanks for reminding this, Alp did commit a class derived from raw_svector_ostream conatining an internal SmallString he called small_string_ostream. The commit was reverted after a day due to a disagreement about the commit approval and apparently abandoned. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140623/223393.html
2015 Apr 30
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
I don't think we should make flush virtual. Why do you need to do it? Can't you set up the base class to write to use the tail of the memory region as the buffer? On 24 April 2015 at 06:46, Yaron Keren <yaron.keren at gmail.com> wrote: > Hi, > > Is this what you're thinking about? > The code is not tested yet, I'd like to know if the overall direction and >
2015 May 02
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
Could you dig into why: + raw_ostream &write(unsigned char C) override { + grow(1); + *OutBufCur++ = C; + return *this; + } Is 3 times as fast as raw_svector_ostream? I don't see a good reason why that should be any faster than: raw_ostream &operator<<(char C) { if (OutBufCur >= OutBufEnd) return write(C); *OutBufCur++ = C; return *this; }
2015 May 02
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
...rt+Size; @@ -751,6 +751,29 @@ OS.append(Ptr, Size); } +void raw_char_ostream::grow(size_t Size) { + size_t CurBytesAvailable = OutBufEnd - OutBufCur; + if (Size > CurBytesAvailable) { + size_t CurPos = OutBufCur - OutBufStart; + OutBufCur = OutBufStart; + size_t NewSize = size_t(NextPowerOf2(CurPos + Size + 2)); + SetBufferAndMode(new char[NewSize], NewSize, DirectBuffer); + OutBufCur = OutBufStart + CurPos; + } +} + +raw_ostream &raw_char_ostream::write(unsigned char C) { + grow(1); + *OutBufCur++ = C; + return *this; +} +raw_ostream &raw_char_ostream::write(const ch...