summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/local_optimizations.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-11-21 15:39:13 -0800
committer buzbee <buzbee@google.com> 2012-11-21 15:39:13 -0800
commit28c9a83398a6e48eefb9b79a390920629bbb8519 (patch)
tree9d12fec60f41a3f185243d0195f9ed31a945005e /src/compiler/codegen/local_optimizations.cc
parentdd20a8d64a8cd120361b44078074bd242913da0a (diff)
Quick Compiler: pointer/boolean cleanup
More minor code cleanup - follow the Art convention of not treating pointers as booleans in "for" loop tests. Change-Id: I2fcd06efe6a51d1195c0900f7fa110fc01110001
Diffstat (limited to 'src/compiler/codegen/local_optimizations.cc')
-rw-r--r--src/compiler/codegen/local_optimizations.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/compiler/codegen/local_optimizations.cc b/src/compiler/codegen/local_optimizations.cc
index d1a74441ae..cf04b21bd7 100644
--- a/src/compiler/codegen/local_optimizations.cc
+++ b/src/compiler/codegen/local_optimizations.cc
@@ -78,9 +78,7 @@ static void ApplyLoadStoreElimination(CompilationUnit* cu, LIR* head_lir, LIR* t
if (head_lir == tail_lir) return;
- for (this_lir = PREV_LIR(tail_lir);
- this_lir != head_lir;
- this_lir = PREV_LIR(this_lir)) {
+ for (this_lir = PREV_LIR(tail_lir); this_lir != head_lir; this_lir = PREV_LIR(this_lir)) {
int sink_distance = 0;
/* Skip non-interesting instructions */
@@ -124,9 +122,7 @@ static void ApplyLoadStoreElimination(CompilationUnit* cu, LIR* head_lir, LIR* t
stop_use_reg_mask = (GetPCUseDefEncoding() | this_lir->use_mask) & ~ENCODE_MEM;
}
- for (check_lir = NEXT_LIR(this_lir);
- check_lir != tail_lir;
- check_lir = NEXT_LIR(check_lir)) {
+ for (check_lir = NEXT_LIR(this_lir); check_lir != tail_lir; check_lir = NEXT_LIR(check_lir)) {
/*
* Skip already dead instructions (whose dataflow information is
@@ -275,9 +271,7 @@ void ApplyLoadHoisting(CompilationUnit* cu, LIR* head_lir, LIR* tail_lir)
if (head_lir == tail_lir) return;
/* Start from the second instruction */
- for (this_lir = NEXT_LIR(head_lir);
- this_lir != tail_lir;
- this_lir = NEXT_LIR(this_lir)) {
+ for (this_lir = NEXT_LIR(head_lir); this_lir != tail_lir; this_lir = NEXT_LIR(this_lir)) {
/* Skip non-interesting instructions */
if ((this_lir->flags.is_nop == true) ||
@@ -308,9 +302,7 @@ void ApplyLoadHoisting(CompilationUnit* cu, LIR* head_lir, LIR* tail_lir)
bool stop_here = false;
/* Try to hoist the load to a good spot */
- for (check_lir = PREV_LIR(this_lir);
- check_lir != head_lir;
- check_lir = PREV_LIR(check_lir)) {
+ for (check_lir = PREV_LIR(this_lir); check_lir != head_lir; check_lir = PREV_LIR(check_lir)) {
/*
* Skip already dead instructions (whose dataflow information is