We re-order and re-arrange the whole thing by instruction type. Also,
instead of returning an Option<u32>, have a has_fixed_latench() method
to check the instruction and then get_dst_latench() to get the latency
from instruction launch to the given destination index being available.
This lets us handle predicates properly which have a different number of
cycles for some reason. Oh, it's now just as correct as the estimates
in nv50_ir_target_gm107.cpp.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This is mostly a refactor but it does tuck in a three functional
changes:
1. We no lonter insert read barriers for sources that we immediately
overwrite in the instruction.
2. We track read and write barriers separately so we don't wait for
read-after-read hazards but do for write-after-read.
3. Wait on all barriers in branch instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
Because of its crazy behavior around overflow, we don't want the full
IADD3 opcode to support any sort of source modifier propagation. This
makes us a new OpIAdd3X opcode which contains all the crazy and lets
IAdd3 remain the usual 32-bit integer thing everyone knows and loves.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
Instead of just taking live-in \ W, consider anything previously spilled
to be spilled. This lets us avoid a bunch of redundant spills because
we now allow spills to persist across blocks even if the value is in W.
In the loop header case, however, we still need to add in live-in \ W or
else we can end up in cases where a value is neither in W nor S.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
Conventional SSA (also called CSSA) requires phi nodes be isolated by
parallel copies such that there is no interference between SSA values.
This is required for many out-of-SSA algorithms and, in our case, a
prerequisite for spilling.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
For spilling, we want to be able to treat TLS as if it were a register
file. It unifies and makes everything easier. Also add support to
OpCopy to for copying between GPR and Mem. We cannot, however copy
directly from Mem to Mem.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
Instead of using OpMov or OpParCopy, use OpCopy directly. This reserves
OpParCopy for RA type things and OpMOv for actual codegen. We can also
drop OpMov from copy propagation now.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This increases the size of RegRef to 32 bits but that's fine given that
it's usually in a union with SSARef which is 128 bits. The real
advantage is that it allows us to start treating memory as a register
type which will come in really useful for spilling.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This gets rid of most of the per-block hash maps and replaces them all
with vectors. This is both simpler and should be quite a bit more
efficient (though block lookup isn't common).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>