[llvm] [DirectX][docs] Expand DXILArchitecture documentation (PR #84077)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 14:59:44 PST 2024


================
@@ -89,6 +89,52 @@ leverage LLVM's current bitcode libraries to do a lot of the work, but
 it's possible that at some point in the future it will need to be
 completely separate as modern LLVM bitcode evolves.
 
+DirectX Backend Flow
+--------------------
+
+The code generation flow for DXIL is broken into a series of passes. The passes
+are grouped into two flows:
+
+#. Generating DXIL IR.
+#. Generating DXIL Binary.
+
+The passes to generate DXIL IR follow the flow:
+
+DXILOpLowering -> DXILPrepare -> DXILTranslateMetadata
+
+Each of these passes has a defined responsibility:
+
+#. DXILOpLowering translates LLVM intrinsic calls to dx.op calls.
+#. DXILPrepare transforms the DXIL IR to be compatible with LLVM 3.7, and
+   inserts bitcasts to allow typed pointers to be inserted.
+#. DXILTranslateMetadata emits the DXIL Metadata structures.
+
+The passes to encode DXIL to binary in the DX Container follow the flow:
+
+DXILEmbedder -> DXContainerGlobals -> AsmPrinter
+
+These passes have defined responsibilities:
----------------
bharadwajy wrote:

```suggestion
Each of these passes have the following defined responsibilities:
```

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


More information about the llvm-commits mailing list