9

[mir-opt] Allow debuginfo to be generated for a constant or a Place

 3 years ago
source link: https://github.com/rust-lang/rust/pull/73210
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Member

wesleywiser commented on Jun 10

Prior to this commit, debuginfo was always generated by mapping a name
to a Place. This has the side-effect that SimplifyLocals cannot remove
locals that are only used for debuginfo because their other uses have
been const-propagated.

To allow these locals to be removed, we now allow debuginfo to point to
a constant value. The ConstProp pass detects when debuginfo points to
a local with a known constant value and replaces it with the value. This
allows the later SimplifyLocals pass to remove the local.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK