Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not align cloned loops #48090

Merged
merged 2 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9232,6 +9232,12 @@ void emitter::emitDispIns(
break;

case IF_NONE:
#if FEATURE_LOOP_ALIGN
if (ins == INS_align)
{
printf("[%d bytes]", id->idCodeSize());
}
#endif
break;

default:
Expand Down
9 changes: 9 additions & 0 deletions src/coreclr/jit/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5319,6 +5319,15 @@ void Compiler::optCloneLoop(unsigned loopInd, LoopCloneContext* context)
// checked them to guarantee they are clonable.
bool cloneOk = BasicBlock::CloneBlockState(this, newBlk, blk);
noway_assert(cloneOk);

#if FEATURE_LOOP_ALIGN
if (blk->isLoopAlign())
{
newBlk->bbFlags &= ~BBF_LOOP_ALIGN;
kunalspathak marked this conversation as resolved.
Show resolved Hide resolved
JITDUMP("Removing LOOP_ALIGN flag from cloned loop in " FMT_BB "\n", newBlk->bbNum);
}
#endif

// TODO-Cleanup: The above clones the bbNatLoopNum, which is incorrect. Eventually, we should probably insert
// the cloned loop in the loop table. For now, however, we'll just make these blocks be part of the surrounding
// loop, if one exists -- the parent of the loop we're cloning.
Expand Down