From 69109c0ace5e3ac831c3b0a5635f25317d3b28bf Mon Sep 17 00:00:00 2001 From: James Iry Date: Thu, 7 Mar 2013 15:05:35 -0800 Subject: 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. --- test/files/jvm/constant-optimization/Foo_1.flags | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/files/jvm/constant-optimization/Foo_1.flags (limited to 'test/files/jvm/constant-optimization/Foo_1.flags') diff --git a/test/files/jvm/constant-optimization/Foo_1.flags b/test/files/jvm/constant-optimization/Foo_1.flags new file mode 100644 index 0000000000..86f52af447 --- /dev/null +++ b/test/files/jvm/constant-optimization/Foo_1.flags @@ -0,0 +1 @@ +-Ynooptimise -Yconst-opt \ No newline at end of file -- cgit v1.2.3