Rate This Document
Findability
Accuracy
Completeness
Readability

Usage

  1. Add the compilation option -fprofile-generate=$PROFILE_DATA_PATH ($PROFILE_DATA_PATH indicates the path for storing sampling files) to compile the source code to obtain an executable file.
  2. Give a group of representative inputs to the executable file and run the executable file for sampling. After sampling, the xxxx.profraw sampling file is generated in $PROFILE_DATA_PATH.
  3. Run cd $PROFILE_DATA_PATH and then run the following command to process the sampling file to obtain the .profdata file:
    1
    $LLVM_DIR/bin/llvm-profdata merge -output=BiSheng.profdata ./*.profraw   # $LLVM_DIR indicates the path of BiSheng compiler.
    
  4. Add the -fprofile-use=$PROFILE_DATA_PATH/BiSheng.profdata option to compile the source code to obtain the optimized executable file.