[all-commits] [llvm/llvm-project] cb15e6: [RISCV] A test for conditional binary ops.

mgudim via All-commits all-commits at lists.llvm.org
Fri Jul 28 08:12:27 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb15e657b5ef5682a9fbda8d881d12cf8d8da79e
      https://github.com/llvm/llvm-project/commit/cb15e657b5ef5682a9fbda8d881d12cf8d8da79e
  Author: Mikhail Gudim <mgudim at gmail.com>
  Date:   2023-07-28 (Fri, 28 Jul 2023)

  Changed paths:
    A llvm/test/CodeGen/RISCV/condbinops.ll

  Log Message:
  -----------
  [RISCV] A test for conditional binary ops.

Consider the following pattern:

```
%binop_ = binop %x, %y
%select_ = select %c, %binop_, %x
```

If there is an identity `%identity` operand for `binop`, it is possible to transform
the above code to:
```
%opearand = select %c, %y, %identity
%result = binop %x, %operand
```
This transformation is profitable when `%identity` is all zeroes or
ones.

This patch commits a test for such patterns.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D155481




More information about the All-commits mailing list