nir: Add a SSA type gathering pass
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 5 Jan 2019 15:13:44 +0000 (09:13 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Sat, 4 May 2019 03:52:05 +0000 (03:52 +0000)
commit91899495a14568e9f23fa64d4bf4f5ef3f017fb9
tree1a60c9941a25099c41948abac1d198454cdd4bba
parent694d1a08d3e5883d97d5352895f8431f76596cb8
nir: Add a SSA type gathering pass

This new pass (which isn't even compile-tested) attempts to determine
the ALU type of all the SSA values in a function impl.  It takes a
greedy approach and assigns intness or floatness to everything it thinks
can possibly contain an int or a float.  Some values will be labled as
both int and float and some will be labled as neither and it is up to
the caller to decide what to do with this information.  However, for a
"nice" shader where the original source contained no bit-casts and no
implicit bit-casts were introduced by optimizations, there shouldn't be
any overlap in the two sets save for the odd CSEd zero constant.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_gather_ssa_types.c [new file with mode: 0644]