Skip to content

Commit

Permalink
no merge
Browse files Browse the repository at this point in the history
  • Loading branch information
amanasifkhalid committed Jan 17, 2024
1 parent f47aaf8 commit 188f2b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/jit/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ bool BasicBlock::IsFirstColdBlock(Compiler* compiler) const
bool BasicBlock::CanRemoveJumpToNext(Compiler* compiler) const
{
assert(KindIs(BBJ_ALWAYS));
return JumpsToNext() && (bbNext != compiler->fgFirstColdBlock);
return JumpsToNext() && (bbNext != compiler->fgFirstColdBlock) && (!hasAlign() || HasFlag(BBF_JMP_TO_NESTED_LOOP));
}

//------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ enum BasicBlockFlags : unsigned __int64
// (TODO: Remove this quirk after refactoring Compiler::fgFindInsertPoint)
BBF_OLD_LOOP_HEADER_QUIRK = MAKE_BBFLAG(42), // Block was the header ('entry') of a loop recognized by old loop finding
BBF_HAS_VALUE_PROFILE = MAKE_BBFLAG(43), // Block has a node that needs a value probing
BBF_JMP_TO_NESTED_LOOP = MAKE_BBFLAG(44),

// The following are sets of flags.

Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5431,6 +5431,13 @@ PhaseStatus Compiler::placeLoopAlignInstructions()
bbHavingAlign = prev;
JITDUMP("Marking " FMT_BB " before the loop with BBF_HAS_ALIGN for loop at " FMT_BB "\n", prev->bbNum,
block->bbNum);

// bbHavingAlign is in a loop, and precedes a nested loop
if (blockToLoop->GetLoop(bbHavingAlign) != nullptr)
{
// If bbHavingAlign is a removable jump, it will be removed despite it having alignment
bbHavingAlign->SetFlags(BBF_JMP_TO_NESTED_LOOP);
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ def replay_with_asm_diffs(self):

# These vars are force overridden in the SPMI runs for both the base and diff, always.
replay_vars = {
"DOTNET_JitAlignLoops": "0", # disable loop alignment to filter noise
"DOTNET_JitAlignLoops": "1", # disable loop alignment to filter noise

This comment has been minimized.

Copy link
@kunalspathak

kunalspathak Feb 2, 2024

I am assuming you will revert this once we see the diffs with your latest changes?

This comment has been minimized.

Copy link
@amanasifkhalid

amanasifkhalid Feb 2, 2024

Author Owner

Sorry, I already reverted this. I'll pull from main and run SPMI locally so we can get the diffs faster.

"DOTNET_JitEnableNoWayAssert": "1",
"DOTNET_JitNoForceFallback": "1",
}
Expand Down

0 comments on commit 188f2b2

Please sign in to comment.