[all-commits] [llvm/llvm-project] ec6131: [LLVM][TableGen] Support type casts of nodes with ...

Stephen Chou via All-commits all-commits at lists.llvm.org
Tue Oct 1 00:17:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec61311e77b39fc7f9b45ffdb8a29b2d96f67265
      https://github.com/llvm/llvm-project/commit/ec61311e77b39fc7f9b45ffdb8a29b2d96f67265
  Author: Stephen Chou <stephenchouca at users.noreply.github.com>
  Date:   2024-10-01 (Tue, 01 Oct 2024)

  Changed paths:
    M llvm/lib/TableGen/TGParser.cpp
    A llvm/test/TableGen/invalid-type-cast-patfrags.td
    A llvm/test/TableGen/multiple-type-casts-patfrags.td
    M llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp

  Log Message:
  -----------
  [LLVM][TableGen] Support type casts of nodes with multiple results (#109728)

Currently, type casts can only be used to pattern match for intrinsics
with a single overloaded return value. For instance:
```
def int_foo : Intrinsic<[llvm_anyint_ty], []>;
def : Pat<(i32 (int_foo)), ...>;
```

This patch extends type casts to support matching intrinsics with
multiple overloaded return values. As an example, the following defines
a pattern that matches only if the overloaded intrinsic call returns an
`i16` for the first result and an `i32` for the second result:
```
def int_bar : Intrinsic<[llvm_anyint_ty, llvm_anyint_ty], []>;
def : Pat<([i16, i32] (int_bar)), ...>;
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list