DASS: Dynamic Adaptive Sub-Target Specialization - Gobran, Tyler; Carvalho, João P. L. de; Barton, Christopher (Anais Estendidos do International Symposium on Computer Architecture and High Performance Computing (SBAC-PAD); 2023: Anais Estendidos do XXXV International Symposium on Computer Architecture and High Performance Computing, 2023)
A new microprocessor within a given processor architecture may introduce performance-improving features that either can only be accessed through novel instructions or require new code-generation techniques to be beneficial. In response, compilers must be extend-ed/improved to make use of these new instructions and to generate better schedules for the new hardware. The compiler improvements that enable these specializations can take significant time to develop, thus applications compiled Ahead-Of-Time (AOT) will often not benefit from code specialization without later recompilation. Furthermore, code compiled for a specific hardware sub-target lacks performance portability, thus, for better performance, there is a need to maintain multiple builds for each processor architecture leading to significant development and maintenance costs. This paper demonstrates that such challenges can be overcome by applying code specialization only to a small percentage of the code in a program. Moreover, it proposes DASS, a novel Dynamic Adaptive Sub-Target Specialization technique to recompile selected parts of a program at runtime. Empirical evidence indicates that selective specialization can achieve up to 93% of whole-program specialization speedup by statically specializing less than 1.5% of the application code. Furthermore, DASS can dynamically achieve performance close to that of static specialization, reaching up to 83% of statically attainable speedup while performing recompilation and redirection during execution.