[all-commits] [llvm/llvm-project] 8599bb: [InstCombine] Fold and-reduce idiom

Max Kazantsev via All-commits all-commits at lists.llvm.org
Thu Jan 27 20:45:02 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8599bb0f26738ed88aae62aba57d82f7cf326cf9
      https://github.com/llvm/llvm-project/commit/8599bb0f26738ed88aae62aba57d82f7cf326cf9
  Author: Max Kazantsev <mkazantsev at azul.com>
  Date:   2022-01-28 (Fri, 28 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp-vec.ll
    M llvm/test/Transforms/InstCombine/reduction-and-sext-zext-i1.ll
    M llvm/test/Transforms/InstCombine/reduction-or-sext-zext-i1.ll

  Log Message:
  -----------
  [InstCombine] Fold and-reduce idiom

This patch introduces folding of and-reduce idiom and generates code
that is easier to read and which is lest costly in terms of icmp operations.
The folding is
```
  icmp eq (bitcast(icmp ne (lhs, rhs)), 0)
```
into
```
  icmp eq(bitcast(lhs), bitcast(rhs))
```

See PR53419.

Differential Revision: https://reviews.llvm.org/D118317
Reviewed By: lebedev.ri, spatel




More information about the All-commits mailing list