2 ms·
There's deducing the range of a variable due to constant expression evaluation and control flow, and then there's deducing its range because of undefined behavi
by barrkel 12y ago
There's deducing the range of a variable due to constant expression evaluation and control flow, and then there's deducing its range because of undefined behaviour.
I believe this analysis is possible; taint the control flow analysis with a flag. Macro expansion and inlined functions are also not intractable; debug information requires tracking token location information all the way through to generated code, so this information can be used to apply a heuristic.
Dead branches don't need to cost that much, BTW. Put the code for disfavoured basic blocks out of line with other code (so it doesn't burn up code cache), and use hinted conditional jumps to enter them (e.g. on x86, forward conditional jumps are predicted not to be taken).
- AgentME 12y agoThat's assuming that apparently dead branches being removed from macros and inlined functions will not cause issues with incorrect code relying on undefined behavior.