nir/spirv: pull out logic for getting builtin locations