diff options
author | James Iry <jamesiry@gmail.com> | 2013-03-07 15:05:35 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-03-07 16:19:31 -0800 |
commit | 69109c0ace5e3ac831c3b0a5635f25317d3b28bf (patch) | |
tree | 191edbde9b7b0ae80dfc3860ff449598c8df5a60 /test/files/neg/t6446-missing.check | |
parent | 5967a664ab1129e28687c591bd94c0e482cb305f (diff) | |
download | scala-69109c0ace5e3ac831c3b0a5635f25317d3b28bf.tar.gz scala-69109c0ace5e3ac831c3b0a5635f25317d3b28bf.tar.bz2 scala-69109c0ace5e3ac831c3b0a5635f25317d3b28bf.zip |
Analyze constants to remove unnecessary branches
This commit adds analysis and optimization of constants to remove
unnecessary branches. It uses abstract interpretation to determine
what constant(s) a particular stack slot or variable might or might not
hold at a given spot and uses that knowledge to eliminate branches that
cannot be taken. Its primary goal is null check removal, but it also
works for other constants.
Several tests are modified to include the new optimization phase.
Two new tests are added. One verifies that branching still works as
expected. The other verifies that branches are removed.
Diffstat (limited to 'test/files/neg/t6446-missing.check')
-rwxr-xr-x | test/files/neg/t6446-missing.check | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/files/neg/t6446-missing.check b/test/files/neg/t6446-missing.check index f976bf480e..6e5bdcf07c 100755 --- a/test/files/neg/t6446-missing.check +++ b/test/files/neg/t6446-missing.check @@ -26,6 +26,7 @@ superaccessors 6 add super accessors in traits and nested classes inliner 23 optimization: do inlining inlinehandlers 24 optimization: inline exception handlers closelim 25 optimization: eliminate uncalled closures - dce 26 optimization: eliminate dead code - jvm 27 generate JVM bytecode - terminal 28 The last phase in the compiler chain + constopt 26 optimization: optimize null and other constants + dce 27 optimization: eliminate dead code + jvm 28 generate JVM bytecode + terminal 29 The last phase in the compiler chain |