From 91c9502fdf437fce5596631e50db5e70c034312a Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Tue, 16 Jul 2024 13:33:00 +0100 Subject: Update InductionVarRange::Replace to match more cases We were missing to update some cases when `instruction` wasn't present in the induction analysis but `fetch` was. We can use `fetch` itself when querying for the InductionInfo to cover both the previous and new cases. Bug: 351868772 Fixes: 351868772 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: m test-art-host-gtest Change-Id: I3c412efdef36d242b0182ed80ce62567c0e3eafc --- compiler/optimizing/induction_var_range.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/induction_var_range.cc') diff --git a/compiler/optimizing/induction_var_range.cc b/compiler/optimizing/induction_var_range.cc index 767a149636..2f5a22ec0e 100644 --- a/compiler/optimizing/induction_var_range.cc +++ b/compiler/optimizing/induction_var_range.cc @@ -368,8 +368,8 @@ void InductionVarRange::Replace(HInstruction* instruction, for (HLoopInformation* lp = instruction->GetBlock()->GetLoopInformation(); // closest enveloping loop lp != nullptr; lp = lp->GetPreHeader()->GetLoopInformation()) { - // Update instruction's information. - ReplaceInduction(induction_analysis_->LookupInfo(lp, instruction), fetch, replacement); + // Update loop's InductionInfo about fetch. + ReplaceInduction(induction_analysis_->LookupInfo(lp, fetch), fetch, replacement); // Update loop's trip-count information. ReplaceInduction(induction_analysis_->LookupInfo(lp, GetLoopControl(lp)), fetch, replacement); } -- cgit v1.2.3-59-g8ed1b