summaryrefslogtreecommitdiff
path: root/compiler/dex/quick/local_optimizations.cc
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2014-03-26 23:25:14 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-03-26 23:25:14 +0000
commitbc428f234ca2885d6689fce82992123479bc643e (patch)
tree446161f82affec1a90ec65e49a4ade10e919a28d /compiler/dex/quick/local_optimizations.cc
parent5e8e4fb94c3584582f0f7bfee1d7faccb4414f54 (diff)
parent99ad7230ccaace93bf323dea9790f35fe991a4a2 (diff)
Merge "Relaxed memory barriers for x86"
Diffstat (limited to 'compiler/dex/quick/local_optimizations.cc')
-rw-r--r--compiler/dex/quick/local_optimizations.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/dex/quick/local_optimizations.cc b/compiler/dex/quick/local_optimizations.cc
index 6df91e674a..dd4af9c15f 100644
--- a/compiler/dex/quick/local_optimizations.cc
+++ b/compiler/dex/quick/local_optimizations.cc
@@ -92,7 +92,10 @@ void Mir2Lir::ApplyLoadStoreElimination(LIR* head_lir, LIR* tail_lir) {
((target_flags & (REG_DEF0 | REG_DEF1)) == (REG_DEF0 | REG_DEF1)) || // Skip wide loads.
((target_flags & (REG_USE0 | REG_USE1 | REG_USE2)) ==
(REG_USE0 | REG_USE1 | REG_USE2)) || // Skip wide stores.
- !(target_flags & (IS_LOAD | IS_STORE))) {
+ // Skip instructions that are neither loads or stores.
+ !(target_flags & (IS_LOAD | IS_STORE)) ||
+ // Skip instructions that do both load and store.
+ ((target_flags & (IS_STORE | IS_LOAD)) == (IS_STORE | IS_LOAD))) {
continue;
}
@@ -293,7 +296,8 @@ void Mir2Lir::ApplyLoadHoisting(LIR* head_lir, LIR* tail_lir) {
/* Skip non-interesting instructions */
if (!(target_flags & IS_LOAD) ||
(this_lir->flags.is_nop == true) ||
- ((target_flags & (REG_DEF0 | REG_DEF1)) == (REG_DEF0 | REG_DEF1))) {
+ ((target_flags & (REG_DEF0 | REG_DEF1)) == (REG_DEF0 | REG_DEF1)) ||
+ ((target_flags & (IS_STORE | IS_LOAD)) == (IS_STORE | IS_LOAD))) {
continue;
}