Introduction to BiSheng Compiler
About This Document
This document describes how to use BiSheng compiler and the precautions for creating service scenarios.
Overview
BiSheng compiler is a high-performance, high-reliability, and easy-to-expand compiler toolchain developed by the Huawei Compiler Laboratory for general-purpose processor architectures, such as Kunpeng. It introduces and enhances multiple compilation optimization technologies and supports different programming languages, such as C, C++, and Fortran, and OpenMP extensions of the corresponding programming languages.
Functions
In addition to general functions and optimization of LLVM, the toolchain of BiSheng compiler has the middle- and back-end key technologies optimized and the Auto-tuner feature integrated to support automatic tuning of the compiler. For details about automatic tuning, see Autotuner Feature Guide.
For some of the common information, see the LLVM user guide at https://llvm.org/docs/UserGuides.html. For details about the new customized options of BiSheng compiler, see Customized Optimization Options.
For details about common optimization methods and additional functions, see BiSheng Compiler Optimization and Programming Guide.
Supported Programming Languages
LLVM is a compiler that supports multiple programming languages and target processors. BiSheng compiler supports C, C++, and Fortran languages. It uses Clang of LLVM as the compiler and driver for C and C++, and Flang as the compiler and driver for Fortran. The OpenMP extensions of the preceding programming languages are supported.
C and C++ programs
Clang is not only a frontend tool for compiling C/C++ source code into LLVM IRs but also a complete compilation driver. It can automatically call the related code's generation optimization phase in the LLVM optimizer to complete the entire process from IRs to target code, and finally output executable binary files. As an important part of the compilation system, BiSheng Compiler integrates modern compilation tool chains, including Clang and LLVM, to provide developers with a complete compilation solution that spans source code preprocessing, IR optimization, and target code generation.
Fortran program
Flang is a Fortran frontend designed for LLVM integration and has two components, which are flang1 and flang2. Flang is also a driver that converts the source code into LLVM IR, which is transferred by the frontend driver for optimization and target code generation.