Splits this pass in to three parts.
First function is to remove StoreContext-LoadContext pairs that are
redundant. Removes the Load that has occured after a store-load pair.
Second function is to remove LoadContext instructions that are redundant
due to no other stores to that location
Third function is to remove StoreContext instructions that are redundant
due to no load happening between them (Relies on previous functions)
Checks to ensure the last op in a block is EndBlock.
Checks to ensure the last instruction before that one is one of the ops
that exit correctly. So ExitFunction, Jump, CondJump, or Break.
Simple linear scan forward of instruction decoding isn't viable to do.
We need to break up the decoding at the block boundaries.
Otherwise our decoding gets in to the weeds and decodes trash.
This changes over CondJump to have a defined True and False branch path.
Additionally needing to change over everything to handle this.
This now means that a false branch condition will no longer assume
fallthrough past this instruction.
Currently the x86-64 JIT generates an additional jmp instruction on
fallthrough that isn't optimized away.
This is working towards improvements in our IR branching model and
improving IRValidation in doing so.
This is working towards the model that IRBlocks can only have 0-2
successors.
Ret/Exit - 0 successors
Jump - 2 successors
CondJump - 2 successors
TBD:
Syscall/CPUID - Breaking block?
Useful for a quick overview of the time spent in a function. It isn't
amazing for profiling since it effects the time in the function by
itself.
Only useful as a reference.
RA spill slots now have live ranges so we can reuse the spill slot.
This can reduce spill stack usage significantly in code ranges with
large live ranges.
Adds an EVEX table and throws some ops in to an unimplemented function.
This is necessary for multiblock in the future where it will see
unsupported instructions but not actually execute them.
Needed to support binaries linked with glibc 2.30 and later.
glibc doesn't actually check CPUID, as kernel support is needed.
Instead, it just calls ARCH_CET_STATUS and checks for an error.