[all-commits] [llvm/llvm-project] 5cbb26: [GVN] Fold equivalent freeze instructions

Juneyoung Lee via All-commits all-commits at lists.llvm.org
Sat Feb 29 14:32:10 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5cbb26569474f33a39942255ba96f3427c155087
      https://github.com/llvm/llvm-project/commit/5cbb26569474f33a39942255ba96f3427c155087
  Author: Juneyoung Lee <aqjune at gmail.com>
  Date:   2020-03-01 (Sun, 01 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/GVN.cpp
    A llvm/test/Transforms/GVN/freeze.ll

  Log Message:
  -----------
  [GVN] Fold equivalent freeze instructions

Summary:
This patch defines two freeze instructions to have the same value number if they are equivalent.

This is allowed because GVN replaces all uses of a duplicated instruction with another.

If it partially rewrites use, it is not allowed. e.g)

```
a = freeze(x)
b = freeze(x)
use(a)
use(a)
use(b)
=>
use(a)
use(b) // This is not allowed!
use(b)
```

Reviewers: fhahn, reames, spatel, efriedma

Reviewed By: fhahn

Subscribers: lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list