[all-commits] [llvm/llvm-project] 98d05f: [GlobalISel] Fix equality for copies from physregs...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Fri Mar 27 17:52:32 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 98d05f88d55b8b2e5a1392110030d5f45ad4cbcf
      https://github.com/llvm/llvm-project/commit/98d05f88d55b8b2e5a1392110030d5f45ad4cbcf
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2020-03-27 (Fri, 27 Mar 2020)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-select.mir

  Log Message:
  -----------
  [GlobalISel] Fix equality for copies from physregs in matchEqualDefs

When we see this:

```
%a = COPY $physreg
...
SOMETHING implicit-def $physreg
...
%b = COPY $physreg
```

The two copies are not equivalent, and so we shouldn't perform any folding
on them.

When we have two instructions which use a physical register check that they
define the same virtual register(s) as well.

e.g., if we run into this case

```
%a = COPY $physreg
...
%b = COPY %a
```

we can say that the two copies are the same, and can be folded.

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




More information about the All-commits mailing list