JIT: Prototype an aggressive SSA-based dead code elimination phase#103087
JIT: Prototype an aggressive SSA-based dead code elimination phase#103087jakobbotsch wants to merge 9 commits into
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
This algorithm unfortunately does not seem to be compatible with IL semantics. In particular it is very non-trivial to identify when we can get rid of conditional backedges because it requires us to prove that the forward edge will eventually be taken. That is, for an example like public static void Test(int k)
{
for (int i = 0; i <= k; i++)
{
}
}the algorithm naturally uncovers that the loop has no side effect, and will happily delete |
Unlike normal liveness based DCE, this algorithm is able to remove loops that do not compute any values that are externally visible.
The algorithm implemented here appears in Cytron, Ron, et al. "Efficiently computing static single assignment form and the control dependence graph.". It was implemented in collaboration with @AndyAyersMS and @TIHan.
Example:
Before:
After: