[PATCH] D61132: [builtins] run-time support for sparse maps in llvm

Shawn Landden via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 08:17:09 PDT 2019


shawnl created this revision.
shawnl added reviewers: jmolloy, hans.
Herald added subscribers: Sanitizers, llvm-commits, mgorny.
Herald added projects: LLVM, Sanitizers.

I am trying to move towards much more space-efficient switch statements, using popcnt, as described in PR39013. This is the run-time component. See D60673 <https://reviews.llvm.org/D60673> and D60982 <https://reviews.llvm.org/D60982> Working, but still needs work code that uses this is here: https://github.com/shawnl/llvm/tree/test

I am hoping on getting some feed-back on this implementation. compiler-rt is written to be very portable, and my patch depends on __popcountll, a GNU extension, as well as eSymbolTypeResolver (IFUNC when using ELF). Also, I had planned to implement a __dosparsejmp() that would directly jump after a tail call, instead of possibly just using __getsparse32/64 here, and that would require special code for every supported architecture.

This is a space-saving improvement, so putting these routines here make sense, even if they need clang to compile.

There are three versions, in 4 sizes (8 16 32 and 64 bits). The three versions are:

- normal: default is the same size as the elements of the table
- unreachable: default is unreachable, meaning some checks can be omitted
- code: default is code (gcc has this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58774 )


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D61132

Files:
  lib/builtins/CMakeLists.txt
  lib/builtins/sparsetable.c
  lib/builtins/sparsetableimpl.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61132.196622.patch
Type: text/x-patch
Size: 5787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190425/36d0a1a6/attachment.bin>


More information about the llvm-commits mailing list