[RFC] Target type classes for extensibility of LLVM IR

So thanks to @jcranmer for weighing in on the review, but it feels like nobody really has a really strong opinion here, so how do we decide?

Part of the problem is that we don’t know the future and how this is going to be used. I do lean towards making this more flexible (meaning: having the properties be per-type), because I think either model (between options 1 and 2) is equally easy to understand, and apart from that I see the potential upsides and downsides as:

  • If it turns out that per type properties are useful in the future, then adding that in after the fact is likely to become a bit painful (questions of upgrade path, backwards compatibility etc.)
  • If it turns out that per type properties will never become useful, then the only cost is ~8 bytes extra per target type instance and potentially a bit of redundancy in .ll/.bc files