Skip to content

Conversation

@kunalspathak
Copy link
Contributor

@kunalspathak kunalspathak commented Jan 22, 2021

During outputting the align instruction, 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 in getLoopSize(). While walking through the IGs in the loop, if we encounter that an IG is also marked as IGF_LOOP_ALIGN, we know that its size included the align instruction size and we were taking off that amount from loopSize (because that is not part of a loop). However, during outputting, we would have also adjusted the align instruction size of such IG and we should take that into account instead of max size of align instruction.

I have added a field paddingAdded in instrDescAlign that tracks the adjusted padding amount which will be used to deduct it when we calculate loopSize during outputting the instruction. Since the check in emitOutputAlign() is under #ifdef DEBUG, I am including the paddingAdded field under #ifdef DEBUG as well. During release, we will never need this and hence will be unnecessary.

I have also made minor changes in JITDUMP.

Fixes: #47094

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 22, 2021
@kunalspathak
Copy link
Contributor Author

@dotnet/jit-contrib , @AndyAyersMS

Remove `paddingNeeded` as we can get that value from `idCodeSie()`.
@kunalspathak
Copy link
Contributor Author

libraries-jitstressregs failures are fixed in #47032.

@kunalspathak
Copy link
Contributor Author

runtime-coreclr jitstressregs failures are related to #11063.

@kunalspathak kunalspathak merged commit a6a7063 into dotnet:master Jan 26, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Feb 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion failed 'paddingToAdd == paddingNeeded'

2 participants