Skip to content

Commit 03a0931

Browse files
authored
fix condition to align method at 32 bytes (#42909)
In #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 65a27aa commit 03a0931

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
@@ -4771,10 +4771,11 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
47714771
#endif
47724772

47734773
#ifdef TARGET_XARCH
4774-
// For x64/x86, align Tier1 methods to 32 byte boundaries if
4774+
// For x64/x86, align methods that are "optimizations enabled" to 32 byte boundaries if
47754775
// they are larger than 16 bytes and contain a loop.
47764776
//
4777-
if (emitComp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER1) && (emitTotalHotCodeSize > 16) && emitComp->fgHasLoops)
4777+
if (emitComp->opts.OptimizationEnabled() && !emitComp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT) &&
4778+
(emitTotalHotCodeSize > 16) && emitComp->fgHasLoops)
47784779
{
47794780
allocMemFlag = CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN;
47804781
}

0 commit comments

Comments
 (0)