nir: add a nir_remove_non_entrypoints helper

This code just got duplicated a lot. There is still more, but the
remaining instances do a bit more than just removing other functions.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <!16348>
175 jobs for !16348 with rusticl/upstream_deps in 35 minutes and 58 seconds (queued for 9 seconds)
latest merge request