nir/clone: Re-use clone_alu for nir_alu_instr_clone
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 18 May 2020 20:37:30 +0000 (15:37 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 19 May 2020 19:31:26 +0000 (19:31 +0000)
commit2c8c5cc87d55546cf3b3bedaf0da5bd3ecede322
treed6817fc06d034ba7cf1884e877d9e97e3e58a8e4
parent4c62dbb145712b49e011feaebd9bf9499b2dfe58
nir/clone: Re-use clone_alu for nir_alu_instr_clone

All it takes are a couple small tweaks to the clone infrastructure to
allow us to use it without any remap table at all.  This reduces code
duplication and the chances for bugs that come with it.  In particular,
the hand-rolled nir_alu_instr_clone didn't preserve no_[un]signed_wrap,
or source/destination modifiers.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5094>
src/compiler/nir/nir_clone.c