[all-commits] [llvm/llvm-project] 63d70e: [GlobalISel] Combine (x op 0) -> x for operations ...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Mon Mar 30 17:03:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 63d70ea6a07131587e09914176551f4437187f78
      https://github.com/llvm/llvm-project/commit/63d70ea6a07131587e09914176551f4437187f78
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2020-03-30 (Mon, 30 Mar 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
    M llvm/include/llvm/Target/GlobalISel/Combine.td
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    A llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-trivial-arith.mir

  Log Message:
  -----------
  [GlobalISel] Combine (x op 0) -> x for operations with a right identity of 0

Implement identity combines for operations like the following:

```
%a = G_SUB %b, 0
```

This can just be replaced with %b.

Over CTMark, this gives some minor size improvements at -O3.

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




More information about the All-commits mailing list