From 423b137214debfa066522763a8e78511d300c8c9 Mon Sep 17 00:00:00 2001 From: Yevgeny Rouban Date: Wed, 15 Oct 2014 17:32:25 +0700 Subject: ART: NullCheckElimination should converge with 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 merge its own calculated MIR_IGNORE_NULL_CHECK with the one came from previous optimizations. Technically NCE_TypeInference calculates the flag in a temporary MIR_MARK-th bit by preserving MIR_IGNORE_NULL_CHECK. Then at the end of NCE pass MIR_MARK is or-ed with MIR_IGNORE_NULL_CHECK. Change-Id: Ib26997c70ecf2c158f61496dee9b1fe45c812096 Signed-off-by: Yevgeny Rouban --- compiler/dex/compiler_enums.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/dex/compiler_enums.h') diff --git a/compiler/dex/compiler_enums.h b/compiler/dex/compiler_enums.h index e4003bf088..78da420339 100644 --- a/compiler/dex/compiler_enums.h +++ b/compiler/dex/compiler_enums.h @@ -311,7 +311,8 @@ enum MIROptimizationFlagPositions { kMIRCallee, // Instruction is inlined from callee. kMIRIgnoreSuspendCheck, kMIRDup, - kMIRMark, // Temporary node mark. + kMIRMark, // Temporary node mark can be used by + // opt passes for their private needs. kMIRStoreNonTemporal, kMIRLastMIRFlag, }; -- cgit v1.2.3-59-g8ed1b