OSDN Git Service

ART: fix NullCheckElimination to preserve MIR_IGNORE_NULL_CHECK
authorYevgeny Rouban <yevgeny.y.rouban@intel.com>
Wed, 1 Oct 2014 11:25:28 +0000 (18:25 +0700)
committerYevgeny Rouban <yevgeny.y.rouban@intel.com>
Tue, 7 Oct 2014 06:16:52 +0000 (06:16 +0000)
commit504b7882fbb841787e350f2da54b1fa9171ce82a
treea65a57afd5b7d850fe8af3c4f693836dcd3b10f2
parent92e7b912929528f23abef6b33d9fa6e6bf327ccc
ART: fix NullCheckElimination to preserve MIR_IGNORE_NULL_CHECK

If the MIRGraph::EliminateNullChecksAndInferTypes() function managed
to prove that some regs are non-null then it sets the flag
MIR_IGNORE_NULL_CHECK and resets this flag for all the other regs.
If some previous optimizations have already set MIR_IGNORE_NULL_CHECK
then it can be reset by EliminateNullChecksAndInferTypes. This way
NullCheckElimination discards some optimization efforts.
Optimization passes should not reset MIR_IGNORE_NULL_CHECK unless
they 100% sure NullCheck is needed.

This patch makes the NCE_TypeInference pass be conservative in
resetting MIR_IGNORE_NULL_CHECK.

Change-Id: I4ea74020968b5c5bd8e3af48211ffd4c6afd7f80
Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
compiler/dex/mir_optimization.cc