diff options
author | Vladimir Marko <vmarko@google.com> | 2021-05-21 09:24:03 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2021-05-24 09:18:28 +0000 |
commit | eb16842455b2a9dc8bbbd62adbf0598ed9a93293 (patch) | |
tree | 059f656c0b4b1b309d7b9d2fa3594ef0d2fbed04 /compiler | |
parent | 34ac64795a2d5bad3b89cf7b16d901c1261fdc15 (diff) |
Fix scheduler's `FieldAccessHeapLocation()`.
Use the correct target for predicated get.
Also remove an always-false condition from LSE.
(cherry picked from commit 642c8f6e69929f46a1a52583cb55b68d83828a02)
Test: m
Bug: 188188275
Bug: 188847019
Merged-In: I731e181c8c0d812120dc4fad0c011158053fa7a8
Change-Id: I39152f60d58039077068fc4a085dc2bbc4579fb7
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/optimizing/load_store_elimination.cc | 3 | ||||
-rw-r--r-- | compiler/optimizing/scheduler.cc | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc index 05862e3b3b..d7cae768d4 100644 --- a/compiler/optimizing/load_store_elimination.cc +++ b/compiler/optimizing/load_store_elimination.cc @@ -2143,8 +2143,7 @@ bool LSEVisitor::MaterializeLoopPhis(ArrayRef<const size_t> phi_placeholder_inde size_t idx = phi_placeholder.GetHeapLocation(); for (HBasicBlock* predecessor : block->GetPredecessors()) { Value value = ReplacementOrValue(heap_values_for_[predecessor->GetBlockId()][idx].value); - if (value.NeedsNonLoopPhi() || - (current_phase_ == Phase::kPartialElimination && value.IsMergedUnknown())) { + if (value.NeedsNonLoopPhi()) { DCHECK(current_phase_ == Phase::kLoadElimination || current_phase_ == Phase::kPartialElimination) << current_phase_; diff --git a/compiler/optimizing/scheduler.cc b/compiler/optimizing/scheduler.cc index 7140e2424a..cb340f530b 100644 --- a/compiler/optimizing/scheduler.cc +++ b/compiler/optimizing/scheduler.cc @@ -149,8 +149,10 @@ size_t SideEffectDependencyAnalysis::MemoryDependencyAnalysis::FieldAccessHeapLo DCHECK(GetFieldInfo(instr) != nullptr); DCHECK(heap_location_collector_ != nullptr); - size_t heap_loc = heap_location_collector_->GetFieldHeapLocation(instr->InputAt(0), - GetFieldInfo(instr)); + HInstruction* ref = instr->IsPredicatedInstanceFieldGet() + ? instr->AsPredicatedInstanceFieldGet()->GetTarget() + : instr->InputAt(0); + size_t heap_loc = heap_location_collector_->GetFieldHeapLocation(ref, GetFieldInfo(instr)); // This field access should be analyzed and added to HeapLocationCollector before. DCHECK(heap_loc != HeapLocationCollector::kHeapLocationNotFound); |