nir/inline_functions: Break inlining into a builder helper
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 4 Mar 2019 21:32:36 +0000 (15:32 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 6 Mar 2019 17:24:57 +0000 (17:24 +0000)
commitde8d80f9cc210367246382c0f1cb30c64fd7da4f
tree352030652cb70014ae9cb9820afeb2e2d224d325
parent0a6b1d058076923fb98d44ac1d2b1bc314635800
nir/inline_functions: Break inlining into a builder helper

This pulls the guts of function inlining into a builder helper so that
it can be used elsewhere.  The rest of the infrastructure is still
needed for most inlining cases to ensure that everything gets inlined
and only ever once.  However, there are use-cases where you just want to
inline one little thing.  This new helper also has a neat trick where it
can seamlessly inline a function from one nir_shader into another.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir.h
src/compiler/nir/nir_clone.c
src/compiler/nir/nir_inline_functions.c