[llvm] [DirectX][DXIL] Distinguish return type for overload type resolution. (PR #85646)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 10:47:20 PDT 2024


================
@@ -398,10 +398,13 @@ static void emitDXILOperationTable(std::vector<DXILOperationDesc> &Ops,
 
   OS << "  static const OpCodeProperty OpCodeProps[] = {\n";
   for (auto &Op : Ops) {
+    // If no overload parameter exists, treat the return type as overload
+    // parameter to emit the appropriate overload kind enum.
+    auto OLParamIdx = (Op.OverloadParamIndex < 0) ? 0 : Op.OverloadParamIndex;
----------------
bharadwajy wrote:

> Is this correct? I think the overload parameter index is always effectively parameter 1. That may match the return type in many cases, but it should always match parameter 1.

Thanks. Pushed a change that incorporates the above with a special consideration for intrinsics with no parameters such as `int_dx_flattened_thread_id_in_group`.

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


More information about the llvm-commits mailing list