OSDN Git Service

Quick: Fix optimizations for empty if blocks.
authorVladimir Marko <vmarko@google.com>
Fri, 19 Jun 2015 11:58:22 +0000 (12:58 +0100)
committerVladimir Marko <vmarko@google.com>
Fri, 19 Jun 2015 15:04:59 +0000 (16:04 +0100)
commit9f7687cb5c1390ec4bcc2f8fa10dbee33aff3d6a
tree91334d4d07517d7da1aab4c46b47649ae791c88b
parentdd3c7d2d6124ceb346b4ed9aa7115f75fc6d3f9f
Quick: Fix optimizations for empty if blocks.

If a block ending with if-eqz or if-nez has the same "taken"
and "fallthrough", we cannot assume that the value has been
checked against zero in one of the succesors. This affects
the null check elimination pass as well as GVN. Refactor all
those checks to a single function in BasicBlock and check
that the "taken" and "falthrough" are different when needed.

Bug: 21614284

(cherry picked from commit f11c420c448baffac6a70ac0884d481ab347e257)

Change-Id: I062e0042de3470ce8680b586487b9c7acbd206bc
compiler/dex/global_value_numbering.cc
compiler/dex/global_value_numbering.h
compiler/dex/mir_graph.h
compiler/dex/mir_optimization.cc
test/800-smali/expected.txt
test/800-smali/smali/b_21614284.smali [new file with mode: 0644]
test/800-smali/src/Main.java