[all-commits] [llvm/llvm-project] fabaca: Revert "[InstCombine] Fold and-reduce idiom"

Hans via All-commits all-commits at lists.llvm.org
Fri Jan 28 03:18:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fabaca10b86f77f7d2d34db91fa6b284da924395
      https://github.com/llvm/llvm-project/commit/fabaca10b86f77f7d2d34db91fa6b284da924395
  Author: Hans Wennborg <hans at chromium.org>
  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:
  -----------
  Revert "[InstCombine] Fold and-reduce idiom"

It causes builds to fail with

llvm/include/llvm/Support/Casting.h:269:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*)
[with X = llvm::IntegerType; Y = const llvm::Type; typename llvm::cast_retty<X, Y*>::ret_type = const llvm::IntegerType*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

See the code review for link to a reproducer.

> 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

This reverts commit 8599bb0f26738ed88aae62aba57d82f7cf326cf9.

This also revertes the dependent change:

"[Test] Add 'ne' tests for and-reduce pattern folding"

This reverts commit a4aaa5995308ac2ba1bf180c9ce9c321cdb9f28a.




More information about the All-commits mailing list