Compilation Options
Scope
This chapter describes the common compilation options in ptoas that are directly relevant to users.
It focuses on the following:
- What user-visible behavior these options control
- What the default behavior is
- When it is recommended to modify them
- How to choose when encountering problems
This chapter does not elaborate on the internal implementation details of ptoas; it only explains these options from the perspective of usage and resulting differences.
Reading Recommendations
If you are using ptoas for the first time, pay attention to the following options first:
- Target architecture selection:
--pto-arch - Options related to auto sync:
--enable-insert-sync,--enable-inject-barrier-all-sync
If you are troubleshooting compilation or result issues, also check:
- Auto memory planning:
--enable-plan-memory(enabled by default and currently cannot be disabled);--plan-memory-order-by-sizeonly adjusts the planning order within the same address space (by default, planning follows the declaration order of tiles)
For the values and default values of the options above, see Option Summary.
Option Summary
The following table summarizes the main command-line options explicitly provided by ptoas.
Note:
- Only options defined by
ptoasitself are listed here. - Common LLVM/MLIR options, such as
--help,--version, and--mlir-print-ir-after, are not elaborated on. - Some options are supported by the tool but are only suitable for specific troubleshooting scenarios.
| Option | Parameter | Default Value | Description |
|---|---|---|---|
<input file> | Path | - | Input .pto file; read from standard input if not specified. |
-o | Path | - | Output file name; output to standard output if not specified (the mixed fatobj mode requires an explicit -o). |
--pto-arch | a3 | a5 | a3 | Specifies the target architecture. |
--enable-plan-memory | None | Enabled | Master switch for automatic memory planning; currently only enabling is supported, and it plans addresses for pto.alloc_tile whose addresses are not explicitly given. |
--plan-memory-order-by-size | None | Disabled | Prioritizes planning larger local buffers within the same address space, and then applies the basic reuse strategy. |
--enable-insert-sync | None | Disabled | Enables regular auto-sync insertion. |
--enable-inject-barrier-all-sync | None | Disabled | Enables a more conservative sync insertion strategy. |
The two auto-sync options in the table above are mutually exclusive: only one of --enable-insert-sync and --enable-inject-barrier-all-sync can be enabled at a time, and specifying both at the same time results in an immediate error.
Option Usage Order
For most users, it is recommended to understand and use these options in the following order:
- Determine
--pto-arch. - Prioritize keeping the default layout-related behavior.
- Enable auto sync as needed.
- Use more conservative sync options or intermediate result observation options only when troubleshooting issues.
Contents
Usage Recommendations
If your goal is to first understand the PTO ISA and write valid programs, you should prioritize keeping the input clear and the semantics explicit, rather than adjusting too many compilation options from the start.