i965/fs: Do not move MOVs writing the flag outside of control flow
authorMatt Turner <mattst88@gmail.com>
Fri, 30 Jun 2017 21:58:22 +0000 (14:58 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 20 Jul 2017 23:56:49 +0000 (16:56 -0700)
commit823893051052c55baece54449ba1f7c2669f4d33
tree2ad6ecc717c388a7a3c1f213beb42fd013531148
parentf1b7c47913344338a8730cf3561ce95527b53c4c
i965/fs: Do not move MOVs writing the flag outside of control flow

The implementation of ballotARB() will start by zeroing the flags
register. So, a doing something like

        if (gl_SubGroupInvocationARB % 2u == 0u) {
                ... = ballotARB(true);
[...]
        } else {
                ... = ballotARB(true);
[...]
}

(like fs-ballot-if-else.shader_test does) would generate identical MOVs
to the same destination (the flag register!), and we definitely do not
want to pull that out of the control flow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_fs_sel_peephole.cpp