[llvm] [DirectX][NFC] Model precise overload type specification of DXIL Ops (PR #83917)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 09:08:48 PDT 2024


================
@@ -219,6 +269,20 @@ static std::string getOverloadKindStr(MVT::SimpleValueType VT) {
     return "OverloadKind::I16 | OverloadKind::I32 | OverloadKind::I64";
   case MVT::fAny:
     return "OverloadKind::HALF | OverloadKind::FLOAT | OverloadKind::DOUBLE";
+  case MVT::Other:
+    // Handle DXIL-specific overload types
+    {
+      auto RetStr =
+          StringSwitch<std::string>(R->getNameInitAsString())
+              .Case("llvm_i16ori32_ty", "OverloadKind::I16 | OverloadKind::I32")
+              .Case("llvm_halforfloat_ty",
+                    "OverloadKind::HALF | OverloadKind::FLOAT")
----------------
bogner wrote:

Hm, I'm not sure that really worked out that well. We're still switching over the names in "getParameterKind" so we haven't really improved the abstraction, and the if chain over the known set of bools is probably just as error prone.

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


More information about the llvm-commits mailing list