Skip to content

Commit 1319978

Browse files
filipnavarapull[bot]
authored andcommitted
Bind the code alignment condition with the loop alignment condition (#107340)
1 parent 9b4d7fc commit 1319978

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/coreclr/jit/emit.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6773,12 +6773,10 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
67736773
#endif
67746774

67756775
#if defined(TARGET_XARCH) || defined(TARGET_ARM64)
6776-
// For x64/x86/arm64, align methods that are "optimizations enabled" to 32 byte boundaries if
6777-
// they are larger than 16 bytes and contain a loop.
6776+
// For x64/x86/arm64, align methods that contain a loop to 32 byte boundaries if
6777+
// they are larger than 16 bytes and loop alignment is enabled.
67786778
//
6779-
if (emitComp->opts.OptimizationEnabled() &&
6780-
(!emitComp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT) || comp->IsTargetAbi(CORINFO_NATIVEAOT_ABI)) &&
6781-
(emitTotalHotCodeSize > 16) && emitComp->fgHasLoops)
6779+
if (codeGen->ShouldAlignLoops() && (emitTotalHotCodeSize > 16) && emitComp->fgHasLoops)
67826780
{
67836781
codeAlignment = 32;
67846782
}

0 commit comments

Comments
 (0)