Skip to main content

Module ipa

Module ipa 

Source
Expand description

What both interprocedural transformations need: which functions are theirs to change.

Design: spec/optimizer/34-ipa.md section 34.6. The two transformations M4 builds, the constant propagation in crate::ipcp and the parameter removal in crate::ipasra, ask the same question before they touch anything, and the spec asks it of both in the same words: any function whose address is taken or which is externally visible cannot be changed at all.

It is one gate here rather than one in each of them because a gate two passes each carry a copy of is a gate two passes can come to disagree about. The disagreement that would follow is a function one of them rewrote the body of and the other rewrote the calls to, with neither of them wrong on its own.

Nothing in here transforms anything. It reads the module and the call graph and says what is reachable from where, which is what makes it safe for a pass to ask again after it has changed something.

Structs§

Sites
Where one function is called from.

Functions§

closed
The functions this unit can see every call to, with the parameters lined up.
operands
Every value the body reads, as an operand or as an argument on an edge.
order
The components of the call graph with callers before callees, each holding only closed nodes.
sites
Every direct call in the module to one of the closed functions, by the function called.