gallivm: Return 0 for first active invocation when no invocations are active.
authorEmma Anholt <emma@anholt.net>
Tue, 28 Feb 2023 20:06:11 +0000 (12:06 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 2 Mar 2023 04:47:35 +0000 (04:47 +0000)
commit1be626b618b2fc632d4692ee6c9e725e37a277ab
tree6a03ac0aee4dc9eacdb1db25dc9d5af3d09eaf65
parente2c67ed63ecdc1485eb3ca2bddbf6b2321093c87
gallivm: Return 0 for first active invocation when no invocations are active.

gallivm doesn't actuially jump across branches where no invocations are
active, so my previous assertion about the exec mask being nonzero was
incorrect.  This means that we'll always use a defined invocation for the
various LLVMBuildExtractElements using the result value, which is an
improvement over my even the code before my cttz change that would use
undefined values for the element to be extracted.

Fixes: 8c2493d041c4 ("gallivm: Use cttz instead of a loop for first_active_invocation().")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c