Skip to content

Commit 32bda3a

Browse files
RalfJunglcnr
andauthored
fix typos
Co-authored-by: lcnr <rust@lcnr.de>
1 parent da3ccb8 commit 32bda3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

text/0000-rust-has-provenance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Since `p1_ptr` and `p2_ptr` are equal, assuming "pointers are just integers" (i.
7676

7777
However, from the perspective of alias analysis, we want this program to have UB: looking at `q` and all pointers to `p2` (which is only `p2_ptr`), we can see that none of them are ever written to, so `p2` will always contain its initial value 42.
7878
Therefore, alias analysis would like to conclude that if this program prints anything, it must print 42, and replace `println!("{}", p2)` by `println!("{}", 42)`.
79-
After this transformation, the program might now print nothing or print 0, even though the original program would never print 0.
79+
After this transformation, the program might now print nothing or print 42, even though the original program would never print 42.
8080
Changing program behavior in this way is a violation of the "as-if" rule that governs what the compiler may do.
8181
The only way to make that transformation legal is to say that the given program has UB.
8282
The only way to make the given program have UB, while keeping the alternative program (that writes to `p2_ptr`) allowed, is to say that `p1_ptr` and `p2_ptr` are somehow different, and writing through one of these pointers is *not* like writing through the other.
@@ -213,7 +213,7 @@ The biggest downside of provenance is complexity. The existence of provenance me
213213

214214
The other main drawback is the lack of proper treatment of provenance in LLVM, our primary codegen backend.
215215
LLVM suffers from various long-standing provenance-related bugs ([[1]](https://github.com/llvm/llvm-project/issues/34577), [[2]](https://github.com/llvm/llvm-project/issues/33896)), and there is currently no concrete plan for how to resolve them.
216-
The opinion on the RFC author is that LLVM needs to stop using pointer comparisons in GVN, and it needs to stop folding ptr2int2ptr cast roundtrips.
216+
The opinion of the RFC author is that LLVM needs to stop using pointer comparisons in GVN, and it needs to stop folding ptr2int2ptr cast roundtrips.
217217
Furthermore, LLVM needs to decide whether the `iN` type carries provenance or not.
218218
To keep all the integer-related optimization, it is likely necessary to decide that it does *not* carry provenance.
219219
This would then necessitate the introduction of a "byte" type that *does* carry provenance, as without such a type it would be impossible to load and store individual bytes (or in general, anything but a ptr-sized chunk of memory) in a provenance-preserving manner.

0 commit comments

Comments
 (0)