[PATCH] D48935: [llvm-exegesis] Provide a way to handle memory instructions.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 30 00:02:54 PDT 2018
lebedev.ri added inline comments.
================
Comment at: tools/llvm-exegesis/lib/BenchmarkRunner.h:77
+ : UnalignedPtr(new char[kSize + kAlignment]),
+ AlignedPtr(UnalignedPtr + kAlignment -
+ (reinterpret_cast<intptr_t>(UnalignedPtr) % kAlignment)) {}
----------------
gchatelet wrote:
> courbet wrote:
> > gchatelet wrote:
> > > courbet wrote:
> > > > gchatelet wrote:
> > > > > Why not [aligned_alloc](https://en.cppreference.com/w/c/memory/aligned_alloc) ?
> > > > >
> > > > the alignment of aligned_alloc has to be an alignment for a valid object. Some X86 instructions require 512 byte alignment, wich is not the alignment of any valid object.
> > > I don't understand why you can't use `aligned_alloc(1024, 1<<20);`?
> > aligned_alloc is c++17...
> I read C++11 on the link I provided.
> https://en.cppreference.com/w/c/memory/aligned_alloc
C11, not C**++**11.
Repository:
rL LLVM
https://reviews.llvm.org/D48935
More information about the llvm-commits
mailing list