aot_comp_option.h 2.8 KB

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