Skip to content

Commit 155ea82

Browse files
authored
Merge pull request #366 from JohnTitor/tweak-aliasing
Fix wording on the aliasing section
2 parents 3a43983 + 74faa41 commit 155ea82

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/aliasing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ These optimizations also tend to prove the soundness of bigger optimizations
8888
such as loop vectorization, constant propagation, and dead code elimination.
8989

9090
In the previous example, we used the fact that `&mut u32` can't be aliased to prove
91-
that writes to `*output` can't possibly affect `*input`. This let us cache `*input`
91+
that writes to `*output` can't possibly affect `*input`. This lets us cache `*input`
9292
in a register, eliminating a read.
9393

9494
By caching this read, we knew that the write in the `> 10` branch couldn't
@@ -118,8 +118,8 @@ fn compute(input: &u32, output: &mut u32) {
118118
}
119119
```
120120

121-
We're still relying on alias analysis to assume that `temp` doesn't alias
122-
`input`, but the proof is much simpler: the value of a local variable can't be
121+
We're still relying on alias analysis to assume that `input` doesn't alias
122+
`temp`, but the proof is much simpler: the value of a local variable can't be
123123
aliased by things that existed before it was declared. This is an assumption
124124
every language freely makes, and so this version of the function could be
125125
optimized the way we want in any language.

0 commit comments

Comments
 (0)