Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce insGroup/instrDesc backwards navigation (#80840)
* Introduce insGroup/instrDesc backwards navigation Currently, it is only possible to walk forwards in insGroup/instrDesc data: insGroup are in a single-linked list, and variable-sized instrDesc are packed into a memory array where function `emitSizeOfInsDsc()` can tell you the size of an instrDesc, and `emitAdvanceInstrDesc()` can advance an `instrDesc*` forward, but there is no facility for walking to the previous instrDesc. This change introduces a `igPrev` pointer so the insGroup list is doubly-linked. Also, each instrDesc is annotated with 4 or 5 bits of data indicating how large the previous instruction in the buffer is, so it is possible to find it by subtracting that size from a `instrDesc*`. Also, each insGroup maintains an `igLastIns` pointer to the last instruction in the group, to allow seeding the backwards walk. The instrDesc backwards walk data is taken from the "small constant" area, so some small constants get pushed to using larger instrDesc sizes. Walking backwards is done using `emitGetLastIns()` to find the last instruction in the function, and `emitPrevID()` to walk to the previous one. This information is currently only used in the JitDump. Basic measurement of the benchmarks SPMI collection showed about a 2.5% increase in emitter memory usage. * Fix one type * Put code under EMIT_BACKWARDS_NAVIGATION define * Disable backwards navigation
- Loading branch information