[PATCH] D64146: [Clang Interpreter] Initial patch for the constexpr interpreter

Nandor Licker via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 07:19:51 PDT 2019

nand added a comment.

The old path-based approach is slow for most operations, while the new pointer-based approach is fast for the most common ones. 
For read/write/update operations, it is enough to check the pointer and at most a single descriptor to ensure whether the operation 
can be performed. For some operations, such as some pointer comparisons, in the worst case the old-style path can be reproduced by
following the pointers produced through the getBase method, allowing us to implement everything.

Extern objects are handled by allocating memory for them, allowing pointers to those regions to exist, but marking the actual storage
as extern/uninitialized and preventing reads/writes to that storage.

Some details of corner cases are not clear at this point, but the fact that we can reproduce full paths and have space to store any special
bits gives me the confidence that we can converge to a full implementation.

I want to stress again the fact that C++ has an insane number of features and I am focusing on implementing as many of them, leaving a 
path towards future optimisations open. I do not want to clobber initial patches with optimisations that would increase complexity - the
few things we do with direct local reads/writes and improved loops already yield significant speedupds.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list