[PATCH] D135190: [DirectX backend] Add analysis to collect DXILResources

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 10:55:05 PDT 2022


beanz added inline comments.


================
Comment at: llvm/lib/Target/DirectX/DXILResource.cpp:65
 
+void UAVResource::print(raw_ostream &O) const {
+  O << "UAV";
----------------
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.


================
Comment at: llvm/lib/Target/DirectX/DXILResource.h:56
 
+  void print(raw_ostream &O) const;
+
----------------
Maybe rather than `print` we make these `dump` functions that default to `dbgs()`, then we can print them in the debugger.


================
Comment at: llvm/lib/Target/DirectX/DXILResourceAnalysis.h:41
+class DXILResourceWrapper : public ModulePass {
+  std::unique_ptr<dxil::Resources> Resources;
+
----------------
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135190/new/

https://reviews.llvm.org/D135190



More information about the llvm-commits mailing list