Skip to content

i965/fs: proper handling of block emptying.

A code that optimises loops may clear a list of parents of block, but it do not care about children of his parents. Example for catched case:

  1. B9 with dependency to B13:
	START B9 IDOM(B7) <-B7 <-B10 <-B11
	   34: do(8) (null):UD,
	END B9 ->B10 ->B13
	...
	START B11 IDOM(B10) <-B10
	   42: mov.nz.f0.0(8) null:D, vgrf27:D
	   43: (+f0.0) break(8) (null):UD,
	END B11 ->B9 ->B12
	START B12 IDOM(B11) <-B11
	   44: while(8) (null):UD,
	END B12 ->B10
	START B13 IDOM(B9) <-B9
	   45: mov(8) vgrf29:D, 1065353216d
	   46: mov(8) vgrf5:UD, 1065353216u
	   47: mov(8) vgrf6:UD, 0u
	   48: mov(8) vgrf7:UD, 0u
	   49: mov(8) vgrf8:UD, 1065353216u
	END B13 ->B14
  1. After combining break-opcode with while-opcode:
	START B9 IDOM(B7) <-B7 <-B10 <-B11
	   34: do(8) (null):UD,
	END B9 ->B10 ->B12
	...
	START B11 IDOM(B10) <-B10
	   42: mov.nz.f0.0(8) null:D, vgrf27:D
	   43: (-f0.0) while(8) (null):UD,
	END B11 ->B10
	START B12 IDOM(B9) <-B9
	   44: mov(8) vgrf29:D, 1065353216d
	   45: mov(8) vgrf5:UD, 1065353216u
	   46: mov(8) vgrf6:UD, 0u
	   47: mov(8) vgrf7:UD, 0u
	   48: mov(8) vgrf8:UD, 1065353216u
	END B12 ->B13
  1. Finally with commit d13bcdb3:
	START B9 IDOM(B7) <-B7 <-B10 <-B11
	   34: do(8) (null):UD,
	END B9 ->B10 ->B12
	START B11 IDOM(B10) <-B10
	   42: mov.nz.f0.0(8) null:D, vgrf27:D
	   43: (-f0.0) while(8) (null):UD,
	END B11 ->B10 ->B12
	START B12 IDOM(B9) <-B11
	   44: mov(8) vgrf29:D, 1065353216d
	   45: mov(8) vgrf5:UD, 1065353216u
	   46: mov(8) vgrf6:UD, 0u
	   47: mov(8) vgrf7:UD, 0u
	   48: mov(8) vgrf8:UD, 1065353216u
	END B12 ->B13

So B9 is storing a child-link to the block that may gone due further optimisations. That is happening with specific shader.

CI: https://mesa-ci.01.org/global_logic/builds/169/group/63a9f0ea7bb98050796b649e85481845 (contains 1 unrelated fail)

CC: Kenneth Graunke kenneth@whitecape.org CC: Matt Turner mattst88@gmail.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111009 Fixes: 9dcf90d7 (intel/fs: Don't emit empty ELSE blocks.) Fixes: d13bcdb3 (i965/fs: Extend predicated break pass to predicate WHILE) Signed-off-by: Sergii Romantsov sergii.romantsov@globallogic.com

Edited by Sergii Romantsov

Merge request reports