[llvm] [DXIL] Add constraint specification and backend implementation of DXIL Ops (PR #97593)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 13:33:34 PDT 2024


================
@@ -13,15 +13,45 @@
 
 include "llvm/IR/Intrinsics.td"
 
-class DXILOpClass;
+// Abstract class to represent major and minor version values
+class Version<int major, int minor> {
+  int Major = major;
+  int Minor = minor;
+}
+
+// Valid Shader model version records
+
+// Shader Model 6.0 - 6.8 and DXIL Version 1.0 - 1.8
+foreach i = 0...8 in {
+  def SM6_#i : Version<6, i>;
+  def DX1_#i : Version<1, i>;
+}
+
+// Resource ValueType - has no size or value
+def resourceVT : ValueType<-1, -1>;
----------------
bogner wrote:

I don't think you can do this, or at least I doubt this does what you think it does. At the very least since `MVT` treats the value here as a `SimpleValueType`, which is 8 bits, presumably a value of `-1` is equivalent to a value of `255` and this reuses the value for `Any`.

This doesn't seem to be used at all yet, so maybe we should just drop it for now and revisit when it can actually be used and tested.

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


More information about the llvm-commits mailing list