Rate This Document
Findability
Accuracy
Completeness
Readability

Feature Overview

During pipeline building, Kunpeng native development offers the BiSheng Compiler, BiSheng JDK, and GCC for openEuler to improve application performance on the Kunpeng platform without the need to modify the source code of applications.

BiSheng Compiler

The BiSheng Compiler is a high-performance, trusted, and scalable compiler toolchain. Designed by the Huawei Compiler Laboratory for general-purpose processor architectures, it introduces and enhances multiple compilation optimization technologies.

  • Compatible with C11, C++ 14/17, and Fortran language standards and OpenMP 4.5/5.0 API specifications.
  • Optimized compilation algorithms for the Kunpeng architecture, with memory optimization, loop optimization, and automatic vectorization.
  • Secure, efficient coding tool sets including static check tools and rebuild tools.

Jenkins and GitLab support non-invasive switching to the BiSheng Compiler. "Non-invasive switching" means that if Clang or Clang++ is used, the BiSheng Compiler-specific compilation options will be added; if GCC or g++ is used, they will be replaced with Clang or Clang++.

Advantages of non-invasive switching:

  • Performance: It performs backend affinity compilation tailored for Kunpeng and applies aggressive optimization for maximum performance without sacrificing precision. Compared with open-source compilers, it delivers on average more than 30% higher performance, and it also provides targeted optimizations for critical scenarios to further improve performance.
  • Security: Compared with GCC, the BiSheng Compiler enforces stricter syntax checking and standards compliance, helping users detect issues earlier, improve code discipline, and enhance overall code quality.

GCC for openEuler

GCC for openEuler can be used directly after installation for compilation, and it also provides the A-FOT feature.

A-FOT is a tool used to improve the usability of the automatic FDO (AutoFDO) feature of GCC for openEuler. This tool enables the full AutoFDO workflow (including sampling, analysis, and optimization) with minimal configuration, streamlining the use of the AutoFDO feature and boosting the performance.

There are two ways to use A-FOT: configuration file-based parameter optimization and command-line parameter optimization.

  • A-FOT supports the two build modes:
    • Wrapper: In this mode, compilation is performed using the A-FOT wrapper.
    • Bear: In this mode, compilation is performed twice.
  • A-FOT supports the three optimization modes:
    • AutoFDO: It is a simplified version of profile-guided optimization (PGO) that uses perf instead of instrumentation to obtain the program runtime profile. The optimization technologies include vectorization, loop unrolling, and loop fission.
    • AutoPrefetch: It is an enhanced prefetch optimizer. Based on the Dcache access and the cache miss rate of access instructions, AutoPrefetch obtains code blocks that can be used for data access optimization, optimizes the prefetch and prefetch lookahead. It is recommended that AutoPrefetch be used together with AutoFDO.
    • AutoBOLT: It is a post-link binary optimizer, which works excellently on programs with complex control flows. The optimization technologies include basic block reordering, function reordering, and function splitting (hot and cold blocks). AutoBOLT cannot be used together with AutoFDO and AutoPrefetch.
  • You need to prepare the build script (build_script) and execution script (run_script) for the application.
  • A-FOT uses the build script to compile the application and the execution script to launch the application for optimization.
  • A-FOT only supports optimization for single-instance applications (meaning only one process is running during application execution).
  • Ensure that the application test cases launched by the execution script behave the same as those in the actual production environment. Otherwise, negative optimization may occur.