OSDN Git Service

aco: don't always add logical edges from continue_break blocks to headers
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 7 Jan 2020 19:13:08 +0000 (19:13 +0000)
committerDylan Baker <dylan@pnwbakers.com>
Mon, 3 Feb 2020 16:31:30 +0000 (08:31 -0800)
commitce0bea311bac2d44e6e99fdc9c1e0bd7be7f8da1
tree3466244aea85d16c5778353e99ddeac40e680046
parent56bc3836ba14014ac5fbcf2c4c2d244c62d426d8
aco: don't always add logical edges from continue_break blocks to headers

Otherwise, code like this will be broken:
loop {
   if (...) {
      break;
   } else {
      break;
   }
}
The continue_or_break block doesn't have any logical predecessors but it's
a logical predecessor of the header block. This liveness error breaks the
spiller in init_live_in_vars() (under "keep variables spilled on all
incoming paths") and eventually creates garbage reloads.

Fixes: 93c8ebfa ('aco: Initial commit of independent AMD compiler')
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3257>
(cherry picked from commit d282a292eca05bd9f701d8509d674e4697f510ec)
.pick_status.json
src/amd/compiler/aco_instruction_selection.cpp