panfrost/midgard: Fix nested/chained if-else
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 17 Feb 2019 05:14:24 +0000 (05:14 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 21 Feb 2019 07:06:26 +0000 (07:06 +0000)
commit2c7470951764045a0f37876cc86daf7285d47a7c
treefe0af8ee3ced6d11761c3dc27a3017c09f725e98
parent5e55c11a1b2a0cfe91fcf58785fabe1269f1c439
panfrost/midgard: Fix nested/chained if-else

An if-else statement is compiled to a conditional branch (from the start
to the second block) and an unconditional branch (from the end of the
first block to the end of the else). We previously incorrectly computed
the block index of the unconditional branch to be exactly one after that
of the conditional branch, valid for a single if-else statement but
nothing fancier. This patch correctly computes the unconditional branch
target, fixing more complex if-else chains.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/midgard/midgard_compile.c