Skip to content

nir: add nir_metadata_control_flow

Alyssa Rosenzweig requested to merge alyssa/mesa:nir/metadata-cf into main

Most passes want to preserve this specific combination of metadata, so let's add an alias for the combination. The alias communicates that the control flow graph is preserved, rather than a particular statement about e.g. dominance preservation.

You don't need to understand dominance to write a simple nir_shader_instructions_pass. And since you were going to cargo cult the metadata anyway, this way you'll cargo cult a version you're more likely to understand.


I squashed the clang-format changes for AGX, but not for other parts of the tree since there's been a bunch of clang-format drift and I don't want to derail this MR with formatting stuff. But if you're looking at the diff and noticing that the wrapping could be prettier now... you're right :}


This is something I've wanted for a while. I could be persuaded to rename to nir_metadata_cf or nir_metadata_cfg but I think nir_metadata_control_flow is the most likely to be understood by newcomers to Mesa/NIR.

Merge request reports