wasm-micro-runtime/core/iwasm/compilation
Wenyong Huang 8d88471c46
Implement AOT static PGO (#2243)
LLVM PGO (Profile-Guided Optimization) allows the compiler to better optimize code
for how it actually runs. This PR implements the AOT static PGO, and is tested on
Linux x86-64 and x86-32. The basic steps are:

1. Use `wamrc --enable-llvm-pgo -o <aot_file_of_pgo> <wasm_file>`
   to generate an instrumented aot file.
2. Compile iwasm with `cmake -DWAMR_BUILD_STATIC_PGO=1` and run
      `iwasm --gen-prof-file=<raw_profile_file> <aot_file_of_pgo>`
    to generate the raw profile file.
3. Run `llvm-profdata merge -output=<profile_file> <raw_profile_file>`
    to merge the raw profile file into the profile file.
4. Run `wamrc --use-prof-file=<profile_file> -o <aot_file> <wasm_file>`
    to generate the optimized aot file.
5. Run the optimized aot_file: `iwasm <aot_file>`.

The test scripts are also added for each benchmark, run `test_pgo.sh` under
each benchmark's folder to test the AOT static pgo.
2023-06-05 09:17:39 +08:00
..
debug core/iwasm/compilation/debug/dwarf_extractor.cpp: remove dead code (#1507) 2022-09-20 14:43:29 +08:00
simd Implement the segue optimization for LLVM AOT/JIT (#2230) 2023-05-26 10:13:33 +08:00
aot_compiler.c Fix multi-threading issues (#2013) 2023-03-08 10:57:22 +08:00
aot_compiler.h Implement the segue optimization for LLVM AOT/JIT (#2230) 2023-05-26 10:13:33 +08:00
aot_emit_aot_file.c Implement AOT static PGO (#2243) 2023-06-05 09:17:39 +08:00
aot_emit_compare.c Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_compare.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_const.c Refactor interpreter/AOT module instance layout (#1559) 2022-10-18 10:59:28 +08:00
aot_emit_const.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_control.c Implement Fast JIT multi-threading feature (#2134) 2023-04-20 10:09:34 +08:00
aot_emit_control.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_conversion.c Simplify fcmp intrinsic logic for AOT/XIP (#1881) 2023-01-12 12:05:53 +08:00
aot_emit_conversion.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_exception.c Refactor interpreter/AOT module instance layout (#1559) 2022-10-18 10:59:28 +08:00
aot_emit_exception.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_function.c aot_compile_op_call: Remove a wrong optimization (#2233) 2023-05-25 07:44:54 +08:00
aot_emit_function.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_memory.c Implement the segue optimization for LLVM AOT/JIT (#2230) 2023-05-26 10:13:33 +08:00
aot_emit_memory.h Implement the segue optimization for LLVM AOT/JIT (#2230) 2023-05-26 10:13:33 +08:00
aot_emit_numberic.c Return result directly if float cmp is called in AOT XIP (#1851) 2022-12-30 16:45:39 +08:00
aot_emit_numberic.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_parametric.c Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_parametric.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_table.c Refine Fast JIT call indirect and call native process (#1620) 2022-10-19 17:11:38 +08:00
aot_emit_table.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_variable.c core/iwasm/compilation: constify a bit (#2223) 2023-05-20 11:55:02 +08:00
aot_emit_variable.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_llvm_extra.cpp Implement AOT static PGO (#2243) 2023-06-05 09:17:39 +08:00
aot_llvm_extra2.cpp wamrc: Add --stack-usage option (#2158) 2023-04-28 13:56:44 +08:00
aot_llvm_extra2.h wamrc: Add --stack-usage option (#2158) 2023-04-28 13:56:44 +08:00
aot_llvm.c Implement AOT static PGO (#2243) 2023-06-05 09:17:39 +08:00
aot_llvm.h Implement AOT static PGO (#2243) 2023-06-05 09:17:39 +08:00
aot_orc_extra.cpp Refactor LLVM JIT (#1613) 2022-10-18 20:17:34 +08:00
aot_orc_extra.h Refactor LLVM JIT (#1613) 2022-10-18 20:17:34 +08:00
aot.c Enable emitting custom name section to aot file (#794) 2021-10-26 16:32:52 +08:00
aot.h Report error in instantiation when meeting unlinked import globals (#1859) 2023-01-06 15:24:11 +08:00
iwasm_compl.cmake Implement atomic and memset/memmove/memcpy intrinsic for riscv (#841) 2021-11-30 17:10:14 +08:00