aot_comp_option.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef __AOT_COMP_OPTION_H__
  6. #define __AOT_COMP_OPTION_H__
  7. typedef struct {
  8. /* Enables or disables bounds checks for stack frames. When enabled, the AOT
  9. * compiler generates code to check if the stack pointer is within the
  10. * bounds of the current stack frame (and if not, traps). */
  11. bool bounds_checks;
  12. /* Enables or disables instruction pointer (IP) tracking. */
  13. bool ip;
  14. /* Enables or disables function index in the stack trace. Please note that
  15. * function index can be recovered from the instruction pointer using
  16. * ip2function.py script, so enabling this feature along with `ip` might
  17. * often be redundant.
  18. * This option will automatically be enabled for GC and Perf Profiling mode.
  19. */
  20. bool func_idx;
  21. /* Enables or disables tracking instruction pointer of a trap. Only takes
  22. * effect when `ip` is enabled. */
  23. bool trap_ip;
  24. /* Enables or disables parameters, locals and stack operands. */
  25. bool values;
  26. /* If enabled, stack frame is generated at the beginning of each
  27. * function (frame-per-function mode). Otherwise, stack frame is
  28. * generated before each call of a function (frame-per-call mode). */
  29. bool frame_per_function;
  30. } AOTCallStackFeatures;
  31. void
  32. aot_call_stack_features_init_default(AOTCallStackFeatures *features);
  33. typedef enum {
  34. AOT_STACK_FRAME_OFF = 0,
  35. /* Use a small stack frame data structure (AOTTinyFrame) */
  36. AOT_STACK_FRAME_TYPE_TINY,
  37. /* Use a regular stack frame data structure (AOTFrame) */
  38. AOT_STACK_FRAME_TYPE_STANDARD,
  39. } AOTStackFrameType;
  40. typedef struct AOTCompOption {
  41. bool is_jit_mode;
  42. bool is_indirect_mode;
  43. char *target_arch;
  44. char *target_abi;
  45. char *target_cpu;
  46. char *cpu_features;
  47. bool is_sgx_platform;
  48. bool enable_bulk_memory;
  49. bool enable_thread_mgr;
  50. bool enable_tail_call;
  51. bool enable_simd;
  52. bool enable_ref_types;
  53. bool enable_gc;
  54. bool enable_aux_stack_check;
  55. AOTStackFrameType aux_stack_frame_type;
  56. AOTCallStackFeatures call_stack_features;
  57. bool enable_perf_profiling;
  58. bool enable_memory_profiling;
  59. bool disable_llvm_intrinsics;
  60. bool disable_llvm_lto;
  61. bool enable_llvm_pgo;
  62. bool enable_stack_estimation;
  63. bool quick_invoke_c_api_import;
  64. char *use_prof_file;
  65. uint32_t opt_level;
  66. uint32_t size_level;
  67. uint32_t output_format;
  68. uint32_t bounds_checks;
  69. uint32_t stack_bounds_checks;
  70. uint32_t segue_flags;
  71. char **custom_sections;
  72. uint32_t custom_sections_count;
  73. const char *stack_usage_file;
  74. const char *llvm_passes;
  75. const char *builtin_intrinsics;
  76. } AOTCompOption, *aot_comp_option_t;
  77. #endif