OSDN Git Service

Fix a bug in the type analysis phase of optimizing.
authorNicolas Geoffray <ngeoffray@google.com>
Mon, 24 Nov 2014 15:28:45 +0000 (15:28 +0000)
committerNicolas Geoffray <ngeoffray@google.com>
Tue, 25 Nov 2014 00:55:07 +0000 (00:55 +0000)
commit3159674c0863f53cfbc1913d493550221ac47f02
tree5dc34e8da8dc695cf80040ba0dbc5312060c10c1
parent4d3ed1a6f34bd31ed30faaca0433cf2a4b19bb7b
Fix a bug in the type analysis phase of optimizing.

Dex code can lead to the creation of a phi with one
float input and one integer input. Since the SSA builder trusts
the verifier, it assumes that the integer input must be converted
to float. However, when the register is not used afterwards, the
verifier hasn't ensured that. Therefore, the compiler must remove
the phi prior to doing type propagation.

Change-Id: Idcd51c4dccce827c59d1f2b253bc1c919bc07df5
13 files changed:
compiler/optimizing/code_generator_x86_64.cc
compiler/optimizing/graph_checker.cc
compiler/optimizing/graph_checker.h
compiler/optimizing/gvn.h
compiler/optimizing/optimization.cc
compiler/optimizing/optimizing_compiler.cc
compiler/optimizing/ssa_builder.cc
compiler/optimizing/ssa_builder.h
compiler/optimizing/ssa_phi_elimination.cc
test/431-type-propagation/expected.txt [new file with mode: 0644]
test/431-type-propagation/info.txt [new file with mode: 0644]
test/431-type-propagation/smali/TypePropagation.smali [new file with mode: 0644]
test/431-type-propagation/src/Main.java [new file with mode: 0644]