• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023-2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14module:
15  name: llvm
16  namespace: ark::llvmbackend
17  description: LLVM AOT compiler for panda
18
19options:
20  - name: llvm-allow-breakage
21    type: bool
22    default: false
23    description: Skip errors during LLVM IR generation
24  - name: llvm-fallback
25    type: bool
26    default: true
27    description: Use Ark Compiler as fallback
28  - name: llvm-inlining
29    type: bool
30    default: true
31    description: >
32      Enable inlining optimization. Default value is overridden by explicit
33      --compiler-inlining which in turn can be overridden by passing this
34      option explicitly
35  - name: llvm-pre-opt
36    type: uint32_t
37    default: 0
38    description: >
39      Level of pre-optimization that LLVMAOT does.
40      0 means running small number of Ark passes before compiling by LLVM.
41      1 means same as 0 but allows Ark Inliner to perform inlining
42      2 is the same as 1 but runs more Ark passes
43  - name: llvm-recursive-inlining
44    type: bool
45    default: true
46    description: Enable inlining for recursive calls
47  - name: llvm-dump-before
48    type: bool
49    default: false
50    description: Whether generated LLVM module should be dumped before optimization passes are run
51  - name: llvm-dump-after
52    type: bool
53    default: false
54    description: Whether generated LLVM module should be dumped after optimization passes are run
55  - name: llvm-dump-codeinfo
56    type: bool
57    default: false
58    description: Print generated code info
59  - name: llvm-dump-obj
60    type: bool
61    default: false
62    description: >
63      Whether llvm backend should dump generated object files.
64      The object files will be dumped to a "llvm-output-{module-number}.o" files in the current working directory,
65      if a file exists it will be overwritten
66  - name: llvm-dump-stackmaps
67    type: bool
68    default: false
69    description: Dump a textual representation of .llvm_stackmaps section into "llvm-stackmaps.txt"
70  - name: llvm-gc-check
71    type: bool
72    default: false
73    description: Run invariant checks after GC intrusion pass
74  - name: llvm-log
75    type: arg_list_t
76    default:
77      - none
78    possible_values:
79      - none
80      - all
81      - infra
82      - stackmaps
83      - ir
84    description: Set log llvm components
85    delimiter: ","
86  - name: llvm-pipeline
87    type: std::string
88    default: ""
89    description: >
90      File with a sequence of llvm's passes, that will be involved into optimization
91      pipeline.
92  - name: llvm-deopts
93    type: bool
94    default: true
95    description: Generate deoptimizations
96  - name: llvm-options
97    type: std::string
98    default: ""
99    description: String with command line options that directly passed into llvm.
100  - name: llvm-builtin-wrb
101    type: bool
102    default: true
103    description: Whether WRB are generated via builtin.
104  - name: llvm-inline-module
105    type: std::string
106    default: ""
107    description: A supplemental LLVM IR bitcode module with additional functions to be inlined
108  - name: llvmaot-methods-per-module
109    type: uint64_t
110    default: 4096
111    description: Number of methods to compile in one llvm module
112  - name: llvm-break-ir-regex
113    type: std::string
114    default: ""
115    description: Debug only. LLVM compiler will break IR on purpose for the functions matching the regex
116    tags: [debug, test]
117  - name: llvm-cpu
118    type: std::string
119    default: "cortex-a55"
120    description: Set target cpu
121  - name: llvm-triple
122    type: std::string
123    default: "aarch64v8.2a-unknown-linux-gnu"
124    description: Set target triple
125  - name: llvmaot-threads
126    type: int32_t
127    default: -1
128    description: >
129      Enables parallel compilation of different modules (see also --llvmaot-methods-per-module)
130      in LLVMAOT mode. Default value is -1 and compilation is sequential. Bigger values allow
131      to specify amount of parallel compilation threads. Value 0 allows to check available
132      hardware parallelism level (#CPUs) automatically.
133