treewide: Convert to use nir_foreach_function_impl and nir_foreach_function_with_impl
In conjunction with !23901 (merged), All usage of nir_foreach_function are converted to nir_foreach_function_impl or nir_foreach_function_with_impl when possible.
This is a following work of !23807 (merged)
And indeed it's founds some unsafe code that doesn't check func->impl != NULL
and fixed.
Signed-off-by: Yonggang Luo luoyonggang@gmail.com
Edited by Yonggang Luo