Now only DXILTranslateMetadata uses DXILResources, so DXILResourceWrapper is only used by DXILTranslateMetadata.
Once we add lower for createHandle, DXILResourceWrapper will be used in more passes.
Also we can add resource index allocation in DXILResourceWrapper.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/DirectX/DXILResource.cpp | ||
---|---|---|
65 ↗ | (On Diff #465239) | How difficult would it be go make the printed output here look more like DXC's disassembly output? It would be very convenient if we could use the printer pass to generate the disassembly printing too. |
llvm/lib/Target/DirectX/DXILResource.h | ||
56 ↗ | (On Diff #465239) | Maybe rather than print we make these dump functions that default to dbgs(), then we can print them in the debugger. |
llvm/lib/Target/DirectX/DXILResourceAnalysis.h | ||
42 | This being a pointer is unfortunate. If you change dxil::Resources to not store a reference to the module (which it probably doesn't need), you could add a public collect method and change it to have a constructor that takes the module and a default constructor that doesn't collect the resources. |
llvm/lib/Target/DirectX/DXILResource.cpp | ||
---|---|---|
70 ↗ | (On Diff #465626) | Instead of a static array if you use a switch statement we don't need the asserts above. |
101 ↗ | (On Diff #465626) | Using a switch here makes sense too. |
176 ↗ | (On Diff #465626) | "comment" is a lot longer to write than just adding a ; to the front of the lines, and just including it in the string avoids double-calling operator<< |
292 ↗ | (On Diff #465626) | here too |
llvm/lib/Target/DirectX/DXILResource.h | ||
83 ↗ | (On Diff #465626) | |
84 ↗ | (On Diff #465626) | |
115 ↗ | (On Diff #465626) |
llvm/lib/Target/DirectX/DXILResource.h | ||
---|---|---|
165 ↗ | (On Diff #465626) | Include llvm/Support/Compiler.h so that LLVM_DUMP_METHOD is properly defined to make the dump method not stripped in debug builds. |
A few last really nitpicky whitespace issues. Otherwise looks good.
llvm/lib/Target/DirectX/DXILResource.cpp | ||
---|---|---|
347 ↗ | (On Diff #465922) | nit: please add a blank line between functions. |
llvm/lib/Target/DirectX/DXILResourceAnalysis.cpp | ||
28 | nit: blank line here too | |
47 | nit: blank line here too | |
llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp | ||
31–34 | nit: blank lines before and after this function too. |
This being a pointer is unfortunate. If you change dxil::Resources to not store a reference to the module (which it probably doesn't need), you could add a public collect method and change it to have a constructor that takes the module and a default constructor that doesn't collect the resources.