mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Add documentation about the UB of the stack2reg optimization
This commit is contained in:
parent
196008bee3
commit
87d6953719
@ -1,3 +1,14 @@
|
||||
//! This optimization replaces stack accesses with SSA variables and removes dead stores when possible.
|
||||
//!
|
||||
//! # Undefined behaviour
|
||||
//!
|
||||
//! This optimization is based on the assumption that stack slots which don't have their address
|
||||
//! leaked through `stack_addr` are only accessed using `stack_load` and `stack_store` in the
|
||||
//! function which has the stack slots. This optimization also assumes that stack slot accesses
|
||||
//! are never out of bounds. If these assumptions are not correct, then this optimization may remove
|
||||
//! `stack_store` instruction incorrectly, or incorrectly use a previously stored value as the value
|
||||
//! being loaded by a `stack_load`.
|
||||
|
||||
use std::collections::{BTreeMap, HashSet};
|
||||
use std::ops::Not;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user