Skip to content

Commit 3c111e8

Browse files
committed
fix condition to align method at 32 bytes (dotnet#42909)
In dotnet#2249, we started doing alignment of methods to 32-byte boundary for Tier1. However, a method having loops bypass tiering and hence this condition was never executed. Fixed it to make sure we do the alignment for optimized methods only and don't do it for prejitted methods.
1 parent 50e5579 commit 3c111e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/coreclr/src/jit/emit.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4776,10 +4776,11 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
47764776
#endif
47774777

47784778
#ifdef TARGET_XARCH
4779-
// For x64/x86, align Tier1 methods to 32 byte boundaries if
4779+
// For x64/x86, align methods that are "optimizations enabled" to 32 byte boundaries if
47804780
// they are larger than 16 bytes and contain a loop.
47814781
//
4782-
if (emitComp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER1) && (emitTotalHotCodeSize > 16) && emitComp->fgHasLoops)
4782+
if (emitComp->opts.OptimizationEnabled() && !emitComp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT) &&
4783+
(emitTotalHotCodeSize > 16) && emitComp->fgHasLoops)
47834784
{
47844785
allocMemFlag = CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN;
47854786
}

0 commit comments

Comments
 (0)