Abstract

The article proposes the methodology of data analysis and code design solutions to improve the flexibility of custom allocator assignment for simple data types and instances of data type classes. The methodology is based on special wrappers of memory functions, collecting data by the execution of source code, and analysing allocation/release traces with subsequent patterns extraction. Then the corresponding custom allocator is chosen for each pattern found and implemented in some module of source code as a container for user data, thus replacing malloc/free. The article describes the usage of the proposed approach for LLVM (Low Level Virtual Machine), which is a well-known tool for building compilers. It is shown that the choice of appropriate allocator provides the improvement of LLVM-based compiler's performance. An appropriate custom allocator is more effective than malloc, in particular, linear allocator is the best for StringMap and DomTreeNodeBase, stack allocator - for BitVector and linked list allocator - for Buckets. Aggregate performance improvement reaches around 10%. The methodology is implemented in shaders' compiler, but can be used in any project that uses LLVM or generally performs memory requests more or less intensively.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call