Skip to content

Commit

Permalink
add --opt-access option
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Aug 27, 2023
1 parent c34d975 commit 1e6f5d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/compiler/compiler-optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ Enable optimizations for mathematical operations.
- Skip the divide-by-zero check for division when operand is constant.
- Skip the divide-by-zero check for modulo when operand is constant.

---

`--opt-access` \
Enable optimizations for memory acessing.

- Skip safety checkings such as boundary checking if accessed to array via constant index expression.

## Optimization Levels

It can be a hassle to pass all flags one by one to send most optimizations to the compiler.
Expand All @@ -66,4 +73,4 @@ Set optimization level to `<level>`.
The optimization levels are as follows:

- `L0`: disable all compiler optimizations (default value of JuleC)
- `L1`: passes `--opt-copy`, `--opt-deadcode`, `--opt-append`, and `--opt-math`
- `L1`: passes `--opt-copy`, `--opt-deadcode`, `--opt-append`, `--opt-math`, and `--opt-access`
12 changes: 12 additions & 0 deletions src/compiler/compiler-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,17 @@ Enable copy optimization.
`--opt-deadcode` \
Enable deadcode optimization.

---

`--opt-append` \
Enable special optimizations for built-in `append` function.

---

`--opt-math` \
Enable special optimizations for mathematical operations.

---

`--opt-access` \
Enable special optimizations for memory accessing.
4 changes: 2 additions & 2 deletions src/standard-library/std-jule-sema.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ For example: `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]`

```jule
struct IndexingExprModel {
expr: ExprModel
index: ExprModel
expr: &Data
index: &Data
}
```
Indexing expression model.\
Expand Down

0 comments on commit 1e6f5d8

Please sign in to comment.