[all-commits] [llvm/llvm-project] b5a936: [InstCombine] canonicalize zext-and-of-bool compar...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Fri Jul 29 09:03:07 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b5a9361c90ca43c715780ab4f7422fbc9d3a067b
      https://github.com/llvm/llvm-project/commit/b5a9361c90ca43c715780ab4f7422fbc9d3a067b
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-07-29 (Fri, 29 Jul 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/and-xor-or.ll
    M llvm/test/Transforms/InstCombine/icmp.ll

  Log Message:
  -----------
  [InstCombine] canonicalize zext-and-of-bool compare to narrow and

https://alive2.llvm.org/ce/z/3jYbEH

We should choose one of these forms, and the option that uses
the narrow type allows the motivating example from issue #56294
to reduce. In the best case (no 'not' needed and 'trunc' remains),
this does remove an instruction.

Note that there is what looks like a regression because there
is an existing canonicalization that turns trunc into and+icmp.
That is a long-standing transform, and I'm not sure what effect
reversing it would have.




More information about the All-commits mailing list