[PATCH] D148194: [TableGen] Reduce the amount of storage space used for AddrSpaces in TypeSetByHwMode. NFC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 12:44:52 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/utils/TableGen/CodeGenDAGPatterns.cpp:86-88
+  // Take the address space from the first type in the list.
+  if (!VTList.empty())
+    AddrSpace = VTList[0].PtrAddrSpace;
----------------
arsenm wrote:
> I've never really understood TypeSetByHwMode. Currently the address space would largely be unused since it doesn't actually work in SelectionDAG. Would this stop you from parameterizing the same pattern over multiple address spaces, or just swapping out the address space based on the hwmode?
TypeSetByHwMode is a set of possible types for each hardware mode.
ValueTypeByHwMode is a single MVT for each hardware mode.

If we needed a different address space for each hardware mode TypeSetByHwMode and ValueTypeByHwMode would both need to store the AddrSpace for each HwMode inside the HwMode map. The `PtrValueType` class in tablegen would need to support HwMode like `ValueTypeByHwMode` and `RegInfoByHwMode`.

If we need to support multiple AddrSpaces with in the possible types for a single hardware mode, that would probably require some enhancement to MachineValueTypeSet.

I don't think either of these were supported before and I don't think this patch makes it worse. I just want to get back the large waste of space. We can add support when we have a use case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148194



More information about the llvm-commits mailing list