aboutsummaryrefslogtreecommitdiffstats
path: root/doc/ccomp.1
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2017-04-05 14:40:55 +0200
committerBernhard Schommer <bschommer@users.noreply.github.com>2017-04-06 15:16:11 +0200
commite5b37a6d1b08ffb3beb15677930992eed747efe1 (patch)
treed34b5c0fd4610c17d5d8dfe4f47b3b3ffe8c5cc2 /doc/ccomp.1
parent6ce07727bcf4e330f897d9461a924334a0f0980e (diff)
downloadcompcert-kvx-e5b37a6d1b08ffb3beb15677930992eed747efe1.tar.gz
compcert-kvx-e5b37a6d1b08ffb3beb15677930992eed747efe1.zip
Another optimization of empty if/else and other useless conditional branches
This commit eliminates useless conditional branches during the branch tunneling pass over LTL. Conditional branches where both successors go to the same LTL node are turned into unconditional branches, which will stay or be eliminated by the subsequent Linear pass. One code pattern that triggers this optimization is an empty if/else at the C source level. Commit 4d7a459 eliminates these empty if/else statements early, during the Compcert C -> Clight translation. I think it's good to have both optimizations: - Early elimination makes sure these empty if/else cause no overhead whatsoever, and in particular cannot degrade the precision of later static analyses. - Late elimination catches the case where a nonempty if/else in the source becomes empty as a consequence of optimizations. Future work? If the optimization in Tunneling triggers, it might be worth re-running the Tunneling pass once more, to make sure that the "Lgoto" introduced by the optimization is properly tunneled / skipped over when appropriate.
Diffstat (limited to 'doc/ccomp.1')
0 files changed, 0 insertions, 0 deletions