The DXILAsmPrinter will just write globals into sections, so the
DXILAsmPrinter only needs support for emitting global variables, and is
otherwise a stub.
Depends on D127147
Differential D127153
[DirectX] Add DXILAsmPrinter beanz on Jun 6 2022, 2:18 PM. Authored by
Details
Diff Detail
Event TimelineComment Actions Would it be possible to test this as-is, or are other changes necessary to meaningfully exercise this code? Comment Actions Sadly no. Until there is an object streamer in place, the ASMPrinter doesn't have anywhere to write to. I had considered getting the DirectX backend to emit dxil into an existing object file format, however the changes to make that work are also significant and would be removed promptly in subsequent commits. Comment Actions Is this the only thing the Asm Printer will ever do? Does it mean you'll never emit asm files or is there another way to get it out (and if there is, why aren't the constants there, too)? Comment Actions At least for DXIL, the assembly is just LLVM IR, so we use the IR printer. I'm modeling how we put bitcode into the final object off how we embed bitcode in other object formats, so the AsmPrinter really only needs to be able to emit globals into sections. Eventually I hope to add DXBC support to the DirectX target too. DXBC is much more like a virtual ISA, and it will have a more functional ASM printer. Comment Actions I don't know much about DirectX but I'm assuming all of those (what, dialects?) will be coming through the same printers/parsers, right? Comment Actions My intent was to do a separate parser & printer for DXBC (DirectX byte code) when we get there. The final output has very little in common with DXIL (DirectX Intermediate Language) other than the binary container format, but the intrinsics, lowering paths, and some optimizations will be shared. My plan is to treat them as different architectures coming out of the same target. For DXIL, handling asm files is going to just be wrapping around the LLVM IR parser and printer, but we need some stubs to emit into object files so the MC layer doesn't get upset. For DXBC we'll eventually need a proper parser & printer and will add full support through MC. Comment Actions @rengolin are you okay with this as-is or are there any changes you would suggest or request? |