Skip to content

Commit

Permalink
JIT: Enable compaction of all BBJ_ALWAYS blocks (#103785)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanasifkhalid committed Jun 21, 2024
1 parent 7fe3451 commit 3b14b0c
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 236 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/jit/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ enum BasicBlockFlags : uint64_t
// Flags to update when two blocks are compacted

BBF_COMPACT_UPD = BBF_GC_SAFE_POINT | BBF_NEEDS_GCPOLL | BBF_HAS_JMP | BBF_HAS_IDX_LEN | BBF_HAS_MD_IDX_LEN | BBF_BACKWARD_JUMP | \
BBF_HAS_NEWOBJ | BBF_HAS_NULLCHECK | BBF_HAS_MDARRAYREF,
BBF_HAS_NEWOBJ | BBF_HAS_NULLCHECK | BBF_HAS_MDARRAYREF | BBF_LOOP_HEAD,

// Flags a block should not have had before it is split.

Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6088,9 +6088,9 @@ class Compiler

void fgPrepareCallFinallyRetForRemoval(BasicBlock* block);

bool fgCanCompactBlocks(BasicBlock* block, BasicBlock* bNext);
bool fgCanCompactBlock(BasicBlock* block);

void fgCompactBlocks(BasicBlock* block, BasicBlock* bNext DEBUGARG(bool doDebugCheck = true));
void fgCompactBlock(BasicBlock* block);

BasicBlock* fgConnectFallThrough(BasicBlock* bSrc, BasicBlock* bDst);

Expand Down Expand Up @@ -6159,7 +6159,7 @@ class Compiler

bool fgIsForwardBranch(BasicBlock* bJump, BasicBlock* bDest, BasicBlock* bSrc = nullptr);

bool fgUpdateFlowGraph(bool doTailDup = false, bool isPhase = false);
bool fgUpdateFlowGraph(bool doTailDup = false, bool isPhase = false, bool doAggressiveCompaction = true);
PhaseStatus fgUpdateFlowGraphPhase();

PhaseStatus fgDfsBlocksAndRemove();
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/fgdiagnostic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void Compiler::fgDebugCheckUpdate()

/* no un-compacted blocks */

if (fgCanCompactBlocks(block, block->Next()))
if (fgCanCompactBlock(block))
{
noway_assert(!"Found un-compacted blocks!");
}
Expand Down
Loading

0 comments on commit 3b14b0c

Please sign in to comment.