[GlobalISel] Implement identity transforms for x op x -> x
authorJessica Paquette <jpaquette@apple.com>
Mon, 30 Mar 2020 22:19:29 +0000 (15:19 -0700)
committerJessica Paquette <jpaquette@apple.com>
Tue, 31 Mar 2020 01:22:37 +0000 (18:22 -0700)
commitd5ee72065b9e5d28f89b1200133e80ce60cb99a0
tree5b5db14395975d7b2a46ce1bef93227f8c7b145f
parent519f5c37962a8b747bf5e6990256a77281fa1d77
[GlobalISel] Implement identity transforms for x op x -> x

When we have

```
a = G_OR x, x
```

or

```
b = G_AND y, y
```

We can drop the G_OR/G_AND and just use x/y respectively.

Also update arm64-fallback.ll because there was an or in there which hits this
transformation.

Differential Revision: https://reviews.llvm.org/D77105
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-binop-same-val.mir [new file with mode: 0644]