[llvm] [DirectX][NFC] Refine DXIL Type abstraction framework in DXIL.td (PR #81692)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 08:37:19 PST 2024


bharadwajy wrote:

> I question whether we should have a DXIL type abstraction at all. DXIL types are effectively just a subset of valid LLVM types. We could use the LLVM type abstractions that we get from Intrinsics.td to provide consistency between DXIL.td and IntrinsicsDirectX.td.

I defined `DXILType` and moved away from leveraging `LLVMType` for 2 reasons:
1. Not all DXIL Operation "types" (e.g., `Cbuffer`, `Handle`, `Overload`) have a backing LLVM Type. Defining those as Pseudo-types along with a `DXILType` seemed clean enough that using TableGen's class inheritance or `multiclass`.
2. It appears that I could use integer values that _currently_ do not  conflict with those already in use to define `ValueType`s for these Pseudo-types, as I proposed in [this commit](https://github.com/llvm/llvm-project/pull/81184/commits/b3b4d49f424f838af3101ac446a772f5a88c1a1f), but retracted due to concerns of potential future conflict. I have not done a careful investigation of the above suppositions. WIll do so and see if I can revive the way of leveraging LLVM Types.
 

https://github.com/llvm/llvm-project/pull/81692


More information about the llvm-commits mailing list