nir: add and use nir_variable::index and nir_index_vars()
This will also be useful for !1240 (merged) to deterministically use variables in hash map keys
Edited by Rhys Perry
This will also be useful for !1240 (merged) to deterministically use variables in hash map keys