[llvm] [DXIL] Add DXIL version-specific TableGen specification and implementation of DXIL Ops (PR #97593)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 09:59:18 PDT 2024


================
@@ -249,17 +309,95 @@ static FunctionType *getDXILOpFunctionType(const OpCodeProperty *Prop,
       ArgTys[0], ArrayRef<Type *>(&ArgTys[1], ArgTys.size() - 1), false);
 }
 
+/// Get index of the property from PropList valid for the most recent
+/// DXIL version not greater than DXILVer.
+/// PropList is expected to be sorted in ascending order of DXIL version.
+template <typename T>
+static int getPropIndex(const std::vector<T> PropList,
+                        const VersionTuple DXILVer) {
+  auto Size = PropList.size();
+  for (int I = Size - 1; I >= 0; I--) {
+    auto OL = PropList[I];
----------------
bharadwajy wrote:

> see: https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable

Changed `auto` to `const T&`

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


More information about the llvm-commits mailing list