spirv: Add cast and loop helpers for vtn_cf_node

Cherry-pick'd from 9d7fcf1de04b69d8657671220265f8ec5e1cd274

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3820>
Change-Id: I52309997d67811d3764aab626f713817aad072b2
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/mesa/+/403193
Reviewed-by: John Bauman <jbauman@google.com>
2 files changed