From f7379df8136a507ff19686573ff6abeec36e1e43 Mon Sep 17 00:00:00 2001 From: Jakob Botsch Nielsen Date: Thu, 18 Jul 2024 11:11:24 +0200 Subject: [PATCH 1/2] Remove unnecessary argument, fix JITDUMP format string --- src/coreclr/jit/inductionvariableopts.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/coreclr/jit/inductionvariableopts.cpp b/src/coreclr/jit/inductionvariableopts.cpp index fba8febf0fe7c..24dc9fb2027f4 100644 --- a/src/coreclr/jit/inductionvariableopts.cpp +++ b/src/coreclr/jit/inductionvariableopts.cpp @@ -1300,7 +1300,7 @@ class StrengthReductionContext bool InitializeCursors(GenTreeLclVarCommon* primaryIVLcl, ScevAddRec* primaryIV); bool IsUseExpectedToBeRemoved(BasicBlock* block, Statement* stmt, GenTreeLclVarCommon* tree); void AdvanceCursors(ArrayStack* cursors, ArrayStack* nextCursors); - bool CheckAdvancedCursors(ArrayStack* cursors, int derivedLevel, ScevAddRec** nextIV); + bool CheckAdvancedCursors(ArrayStack* cursors, ScevAddRec** nextIV); bool StaysWithinManagedObject(ArrayStack* cursors, ScevAddRec* addRec); bool TryReplaceUsesWithNewPrimaryIV(ArrayStack* cursors, ScevAddRec* iv); BasicBlock* FindUpdateInsertionPoint(ArrayStack* cursors); @@ -1423,7 +1423,7 @@ bool StrengthReductionContext::TryStrengthReduce() // Verify that all cursors still represent the same IV ScevAddRec* nextIV = nullptr; - if (!CheckAdvancedCursors(nextCursors, derivedLevel + 1, &nextIV)) + if (!CheckAdvancedCursors(nextCursors, &nextIV)) { break; } @@ -1734,7 +1734,7 @@ void StrengthReductionContext::AdvanceCursors(ArrayStack* cursors, A for (int i = 0; i < nextCursors->Height(); i++) { CursorInfo& nextCursor = nextCursors->BottomRef(i); - printf(" [%d] [%06u]%s: ", i, nextCursor.Tree == nullptr ? 0 : Compiler::dspTreeID(nextCursor.Tree)); + printf(" [%d] [%06u]: ", i, nextCursor.Tree == nullptr ? 0 : Compiler::dspTreeID(nextCursor.Tree)); if (nextCursor.IV == nullptr) { printf(""); @@ -1755,8 +1755,6 @@ void StrengthReductionContext::AdvanceCursors(ArrayStack* cursors, A // // Parameters: // cursors - List of cursors that were advanced. -// derivedLevel - The derived level of the advanced IVs. That is, the number -// of times they are derived from the primary IV. // nextIV - [out] The next derived IV from the subset of advanced // cursors to now consider strength reducing. // @@ -1769,7 +1767,6 @@ void StrengthReductionContext::AdvanceCursors(ArrayStack* cursors, A // decides to no longer consider some cursors for strength reduction. // bool StrengthReductionContext::CheckAdvancedCursors(ArrayStack* cursors, - int derivedLevel, ScevAddRec** nextIV) { *nextIV = nullptr; From 9dc2248aba11b981e5fb37a3fe414df04034389d Mon Sep 17 00:00:00 2001 From: Jakob Botsch Nielsen Date: Thu, 18 Jul 2024 11:47:34 +0200 Subject: [PATCH 2/2] Run jit-format --- src/coreclr/jit/inductionvariableopts.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/coreclr/jit/inductionvariableopts.cpp b/src/coreclr/jit/inductionvariableopts.cpp index 24dc9fb2027f4..748c5adebd629 100644 --- a/src/coreclr/jit/inductionvariableopts.cpp +++ b/src/coreclr/jit/inductionvariableopts.cpp @@ -1766,8 +1766,7 @@ void StrengthReductionContext::AdvanceCursors(ArrayStack* cursors, A // This function may remove cursors from m_cursors1 and m_cursors2 if it // decides to no longer consider some cursors for strength reduction. // -bool StrengthReductionContext::CheckAdvancedCursors(ArrayStack* cursors, - ScevAddRec** nextIV) +bool StrengthReductionContext::CheckAdvancedCursors(ArrayStack* cursors, ScevAddRec** nextIV) { *nextIV = nullptr;