mesa/src/freedreno
Connor Abbott 94cb129d51 ir3/ra: Fix off-by-one issues with live-range extension
The intersects() function assumes that inside each instruction values
always die before they are defined, so that if the end of one range is
the same instruction as the beginning of the next then they don't
intersect. However, this isn't the case for values that become live at
the beginning of a basic block, which become live *before* the first
instruction, or instructions that die at the end of a basic block which
die after the last instruction.

For example, imagine that we have two values, A which is defined earlier
in the block and B which is defined in the last instruction of the block
and both die at the end of the basic block (e.g. are used in the next
iteration of a loop). We would compute a range for A of, say, (10, 20)
and for B of (20, 20) since each block's end_ip is the same as the ip of
the last instruction, and RA would consider them to not interfere.
There's a similar problem with values that become live at the beginning.

The fix is to offset the block's start_ip and end_ip by one so that they
don't correspond to any actual instruction. One way to think about this
is that we're adding fake instructions at the beginning and end of a
block where values become live & die. We could invert the order, so that
values consumed by each instruction are considered dead at the end of
the previous instruction, but then values that become dead at the
beginning of the basic block would incorrectly have an empty live range,
with a similar problem at the end of the basic block if we try to say
that values are defined at the beginning of the next instruction. So
the extra padding instructions are unavoidable.

This fixes an accidental infinite loop in the shader for
dEQP-VK.spirv_assembly.type.scalar.u32.switch_vert.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4614>
2020-04-18 17:31:56 +00:00
..
computerator freedreno/computerator: support bindless sampler instructions 2020-04-13 20:15:48 +00:00
drm meson: inline inc_common 2020-03-28 21:36:54 +01:00
drm-shim drm-shim: return device platform as specified 2020-04-03 21:14:18 +00:00
fdl freedreno/a6xx: Set a level's pitch based on minified level0 pitch, not width0. 2020-04-07 18:02:56 +00:00
ir3 ir3/ra: Fix off-by-one issues with live-range extension 2020-04-18 17:31:56 +00:00
perfcntrs meson: inline inc_common 2020-03-28 21:36:54 +01:00
registers freedreno/turnip: Update GRAS_LAYER_CNTL to GRAS_MAX_LAYER_INDEX 2020-04-15 16:19:34 +00:00
vulkan tu: Use tu_cs_add_entries() with non-render-pass secondaries 2020-04-17 14:11:07 +00:00
.dir-locals.el freedreno: Make emacs indent the way robclark's eclipse does. 2019-05-13 15:37:01 -07:00
.editorconfig freedreno: Make .editorconfig match .dir-locals.el. 2019-05-13 15:37:01 -07:00
Android.drm.mk mesa: android: freedreno: build libfreedreno_{drm,ir3} static libs 2019-05-06 11:29:26 +00:00
Android.ir3.mk mesa: android: freedreno: build libfreedreno_{drm,ir3} static libs 2019-05-06 11:29:26 +00:00
Android.mk freedreno/perfcntrs: move to shared location 2019-11-21 20:01:03 +00:00
Android.perfcntrs.mk freedreno: android: fix build of perfcounters. 2020-02-07 16:34:49 +00:00
Android.registers.mk freedreno: android: add a6xx-pack.xml.h generation to android build 2020-02-07 16:34:49 +00:00
Makefile.sources freedreno/ir3: rename depth->dce 2020-04-13 20:47:28 +00:00
meson.build freedreno: Add the outline of a test for a6xx texture layout. 2020-04-07 18:02:56 +00:00