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.
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.
C and C++ programs
Clang is not only a C and C++ frontend IR that compiles a program into LLVM middleware. It is also a driver ensuring that the required LLVM optimization pass is called to generate code and finally a binary file. BiSheng compiler provides all the tools and libraries required for E2E compiler programs.
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.