Calculate loopSize based on post align adjusted size #47350
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During outputting the
aligninstruction, we recalculate the alignment needed to make sure that the padding we calculated earlier still matches when calculated on the basis of actual buffer address. In that, we calculate loopSize ingetLoopSize(). While walking through the IGs in the loop, if we encounter that an IG is also marked asIGF_LOOP_ALIGN, we know that its size included thealigninstruction size and we were taking off that amount fromloopSize(because that is not part of a loop). However, during outputting, we would have also adjusted thealigninstruction size of such IG and we should take that into account instead of max size ofaligninstruction.I have added a fieldpaddingAddedininstrDescAlignthat tracks the adjusted padding amount which will be used to deduct it when we calculateloopSizeduring outputting the instruction. Since the check inemitOutputAlign()is under#ifdef DEBUG, I am including thepaddingAddedfield under#ifdef DEBUGas well. During release, we will never need this and hence will be unnecessary.I have also made minor changes in
JITDUMP.Fixes: #47094