-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Clean up localloc implementation #6276
Conversation
// push_hide means don't track the stack | ||
inst_IV(INS_push_hide, 0); | ||
cntPtrSizedWords--; | ||
inst_IV(INS_push_hide, 0); // push_hide means don't track the stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An extra comment might be nice here - we're not tracking the stack because the stack tracking is updated separately for localloc, or ...?
LGTM with just a couple of comment suggestions. |
Looks good. |
src/jit/codegenxarch.cpp
Outdated
// Align to STACK_ALIGN | ||
// regCnt will be the total number of bytes to localloc | ||
inst_RV_IV(INS_add, regCnt, (STACK_ALIGN - 1), emitActualTypeSize(type)); | ||
// Align the number of bytes to allocate to STACK_ALIGN. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should read more like "Round up to the number of bytes to the next higher STACK_ALIGN "
LGTM with comments |
@briansull - Is this change applicable to Arm64 implementation of genLclHeap()? More specifically, if we have a smaller instruction to decrement a register, we can use that instead of "sub reg, 16" by converting regCnt to loop-iteration count for compInitMem case. |
I added / improved a bunch of comments per suggestions |
3d8eb37
to
7a516a2
Compare
There aren't any "smaller" instructions on ARM64. |
…anup Clean up localloc implementation Commit migrated from dotnet/coreclr@e8bdf3e
Reduce the differences between x86 and AMD64 codegen to reduce the number of
#ifdef
s. This changes AMD64 codegen for initialized locallocs by using the x86 style "dec" loop instead of "sub rsp,16". Saves one byte of code size per instance. I ran all standard internal testing on this change.@sivarv PTAL
cc @dotnet/jit-contrib