File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1818//!
1919//! By opportunity, this pass simplifies some `Rvalue`s based on the accumulated knowledge.
2020//!
21+ //! # Operational semantic
22+ //!
23+ //! Operationally, this pass attempts to prove bitwise equality between locals. Given this MIR:
24+ //! ```ignore (MIR)
25+ //! _a = some value // has VnIndex i
26+ //! // some MIR
27+ //! _b = some other value // also has VnIndex i
28+ //! ```
29+ //!
30+ //! We consider it to be replacable by:
31+ //! ```ignore (MIR)
32+ //! _a = some value // has VnIndex i
33+ //! // some MIR
34+ //! _c = some other value // also has VnIndex i
35+ //! assume(_a bitwise equal to _c) // follows from having the same VnIndex
36+ //! _b = _a // follows from the `assume`
37+ //! ```
38+ //!
39+ //! Which is simplifiable to:
40+ //! ```ignore (MIR)
41+ //! _a = some value // has VnIndex i
42+ //! // some MIR
43+ //! _b = _a
44+ //! ```
45+ //!
2146//! # Handling of references
2247//!
2348//! We handle references by assigning a different "provenance" index to each Ref/AddressOf rvalue.
You can’t perform that action at this time.
0 commit comments