summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dave Allison <dallison@google.com> 2014-08-05 21:32:46 -0700
committer Dave Allison <dallison@google.com> 2014-08-06 19:40:27 +0000
commitadc73cbe869f9560cf84bda2e953a2b267b1438f (patch)
tree0b4a2d6a914d4a80cedafe0e356fc37335222b8c
parent860feb0a60d0fe9311f28bd590058f6660d130b1 (diff)
Fix checks for kLiteral in local optimizations.
The check for kLiteral (literal load) just checked the kLiteral bit in the def mask. The kEncodeAll mask has the kLiteral bit set so this check was triggering. The fix is to check for only the kLiteral bit being set and no other special bits. The semantics of the special bits in the use/def mask is that only one of them can be set at the same time. Bug: 16824330 Change-Id: I0f1c1157e017870414ffef11767e5433d1fd4401
-rw-r--r--compiler/dex/quick/local_optimizations.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/dex/quick/local_optimizations.cc b/compiler/dex/quick/local_optimizations.cc
index eec2b32726..e0f4691063 100644
--- a/compiler/dex/quick/local_optimizations.cc
+++ b/compiler/dex/quick/local_optimizations.cc
@@ -200,7 +200,7 @@ void Mir2Lir::ApplyLoadStoreElimination(LIR* head_lir, LIR* tail_lir) {
/* Initialize alias list */
alias_list.clear();
ResourceMask alias_reg_list_mask = kEncodeNone;
- if (!this_mem_mask.Intersects(kEncodeLiteral)) {
+ if (!this_mem_mask.Intersects(kEncodeMem) && !this_mem_mask.Intersects(kEncodeLiteral)) {
alias_list.push_back(dest_reg_id);
SetupRegMask(&alias_reg_list_mask, dest_reg_id);
}
@@ -248,7 +248,7 @@ void Mir2Lir::ApplyLoadStoreElimination(LIR* head_lir, LIR* tail_lir) {
bool is_check_lir_load = check_flags & IS_LOAD;
bool reg_compatible = RegStorage::SameRegType(check_lir->operands[0], native_reg_id);
- if (alias_mem_mask.Equals(kEncodeLiteral)) {
+ if (!alias_mem_mask.Intersects(kEncodeMem) && alias_mem_mask.Equals(kEncodeLiteral)) {
DCHECK(check_flags & IS_LOAD);
/* Same value && same register type */
if (reg_compatible && (this_lir->target == check_lir->target)) {