<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58537>58537</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            "Type set is empty for each HW mode" if all register classes have [untyped] RegTypes
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          s-barannikov
      </td>
    </tr>
</table>

<pre>
    `$ cat test.td`
```
include "llvm/Target/Target.td"

def R0 : Register<"ar0">;

let Size = 32 in
def R : RegisterClass<"", [untyped], 32, (add R0)>;

def MyTarget : Target;
```

`$ llvm-tblgen -gen-instr-info -I llvm/include test.td`

This results in:

```
Type set is empty for each HW mode:
possible type contradiction in the pattern below (use -print-records with llvm-tblgen to see all expanded records).
atomic_cmp_swap_16_acq_rel(ptr, cmp, val): Generated from record:
atomic_cmp_swap_16_acq_rel {    // SDPatternOperator PatFrags PatFrag
...
}
Included from test.td:1:
Included from llvm/include/llvm/Target/Target.td:1802:
llvm/include/llvm/Target/TargetSelectionDAG.td:1561:7: error: Type set is empty for each HW mode in 'atomic_cmp_swap_16_acq_rel'
  def NAME#_acq_rel : PatFrag<(ops node:$ptr, node:$cmp, node:$val),
      ^
Included from test.td:1:
Included from llvm/include/llvm/Target/Target.td:1802:
llvm/include/llvm/Target/TargetSelectionDAG.td:1624:19: note: instantiated from multiclass
  defm NAME#_16 : ternary_atomic_op_ord;
                  ^
Included from test.td:1:
Included from llvm/include/llvm/Target/Target.td:1802:
llvm/include/llvm/Target/TargetSelectionDAG.td:1642:25: note: instantiated from multiclass
defm atomic_cmp_swap  : ternary_atomic_op<atomic_cmp_swap>;
```

It took me some time to figure out that the reason for this error message is that the register class has `[untyped]` type list.
It would be nice to have clearer error message or none at all.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVVUtz2zYQ_jXUZUcaCnxJBx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