In this paper, we propose a novel, annotation based approach to optimize recursive functions in C/C++ codes. It can be used to fully remove recursive structures, optimize the working pattern and gives the developer fine grain control over inlining behavior, leading to speedups of up to 40x. To achieve this we use Clang annotations and have developed an LLVM compiler pass that parses the developer given annotation and transforms the code accordingly. We demonstrate the effectiveness of this approach on 5 well known recursive algorithms. Our experiments show, that recursive functions that are not limited by memory bandwidth but computation intensity benefit the most from this optimization. Our code is available at https://github.com/tudasc/SpecRecUnroll .

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Speculative Recursion Unrolling

  • Tim Heldmann,
  • Tim Ziegler,
  • Peter Arzt,
  • Christian Bischof

摘要

In this paper, we propose a novel, annotation based approach to optimize recursive functions in C/C++ codes. It can be used to fully remove recursive structures, optimize the working pattern and gives the developer fine grain control over inlining behavior, leading to speedups of up to 40x. To achieve this we use Clang annotations and have developed an LLVM compiler pass that parses the developer given annotation and transforms the code accordingly. We demonstrate the effectiveness of this approach on 5 well known recursive algorithms. Our experiments show, that recursive functions that are not limited by memory bandwidth but computation intensity benefit the most from this optimization. Our code is available at https://github.com/tudasc/SpecRecUnroll .