[clang] [llvm] [HLSL] Adding Flatten and Branch if attributes (PR #116331)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 18 11:30:04 PST 2024


================
@@ -53,3 +53,6 @@ LLVM_FIXED_MD_KIND(MD_DIAssignID, "DIAssignID", 38)
 LLVM_FIXED_MD_KIND(MD_coro_outside_frame, "coro.outside.frame", 39)
 LLVM_FIXED_MD_KIND(MD_mmra, "mmra", 40)
 LLVM_FIXED_MD_KIND(MD_noalias_addrspace, "noalias.addrspace", 41)
+// TODO: this will likelly be placed somewhere else,
+// so we don't mix dxil/hlsl/spirv and clang metadata
+LLVM_FIXED_MD_KIND(MD_dxil_controlflow_hints, "dx.controlflow.hints", 42)
----------------
llvm-beanz wrote:

A note about how we handle these attributes today in our fork:

We do nothing in the IR optimizer to force preserving or flattening branches. If the branches these attributes are attached to survive through optimization we encode the attribute into the DXIL that gets handed to the backend. If not, it gets dropped. We don't expect to change that behavior, although we may implement passes to perform flattening/preserving when we look at lowering to ISA.

https://github.com/llvm/llvm-project/pull/116331


More information about the cfe-commits mailing list