Nvidia’s enginers trying to Improve GCC Compiler

chips gpu hardware

In a recent development for the open-source compiler community, NVIDIA compiler engineers are working on a standalone tool to generate AutoFDO (Automatic Feedback Directed Optimization) profiles specifically for the GNU Compiler Collection (GCC). This initiative aims to fill a gap currently filled by Google’s AutoFDO tools, which are tailored for LLVM/Clang rather than GCC.

The Need for GCC-Focused AutoFDO

AutoFDO is a powerful optimization technique that allows compilers to generate more efficient binaries by analyzing runtime profiles of applications. Traditionally, GCC has lagged behind LLVM/Clang in this area, as Google’s AutoFDO tools have been optimized for LLVM’s ecosystem. According to discussions on the GCC mailing list, Google intends to archive its AutoFDO repository, which poses a challenge for GCC users who rely on these tools for performance improvements.

NVIDIA’s Proposed Solution

NVIDIA engineer Kugan Vivekanandarajah has proposed a new tool that would be upstreamed into the GCC codebase. The tool is designed to:

  • Be lightweight and memory efficient
  • Work seamlessly with the GNU toolchain
  • Generate AutoFDO profiles for consumption by GCC during secondary builds

This would enable GCC to benefit from the same level of optimization as LLVM/Clang when using AutoFDO. The proposal emphasizes that the tool will not require instrumentation, instead relying on optimized binaries with debug information to collect profiles, similar to Google’s approach but tailored for GCC.

Benefits of AutoFDO

AutoFDO can deliver significant performance improvements, with reports indicating speedups ranging from 50% to 110% of what is achieved with traditional FDO methods. For CPU-intensive applications, the average improvement is between 70% and 80%. These optimizations include instruction scheduling, basic block reordering, function splitting, and register allocation.

Community Response and Next Steps

The proposal has been well-received by the GCC community, which recognizes the importance of having a dedicated AutoFDO tool for GCC. The discussion on the GCC mailing list highlights the need to either fork Google’s existing tools or develop new GCC-specific tooling from scratch. NVIDIA’s initiative could provide a long-term solution, ensuring that GCC remains competitive in the field of compiler optimizations.

The request for comments was posted to the GCC mailing list, and the community is encouraged to participate in shaping the future of AutoFDO support in GCC.

Source: Phoronix

Leave a Reply

Your email address will not be published. Required fields are marked *