Skip to content

Commit

Permalink
fix condition to align method at 32 bytes (dotnet#42909)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kunalspathak committed Oct 16, 2020
1 parent 50e5579 commit 3c111e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/coreclr/src/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4776,10 +4776,11 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
#endif

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

0 comments on commit 3c111e8

Please sign in to comment.