[all-commits] [llvm/llvm-project] 466632: [InstSimplify] add tests for bitwise logic fold of...

RotateRight via All-commits all-commits at lists.llvm.org
Wed Oct 6 09:33:14 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4666324f2bbd82b5fb218bef3c41121d5494ff4a
      https://github.com/llvm/llvm-project/commit/4666324f2bbd82b5fb218bef3c41121d5494ff4a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-10-06 (Wed, 06 Oct 2021)

  Changed paths:
    M llvm/test/Transforms/InstSimplify/and.ll

  Log Message:
  -----------
  [InstSimplify] add tests for bitwise logic fold of 'and'; NFC


  Commit: e36d351d19b1365275c7d5f2bf4e6ac17a42ad2c
      https://github.com/llvm/llvm-project/commit/e36d351d19b1365275c7d5f2bf4e6ac17a42ad2c
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-10-06 (Wed, 06 Oct 2021)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/and.ll

  Log Message:
  -----------
  [InstSimplify] (x | y) & (x | !y) --> x

https://alive2.llvm.org/ce/z/QagQMn

This fold is handled by instcombine via SimplifyUsingDistributiveLaws(),
but we are missing the sibliing fold for 'logical and' (implemented with
'select'). Retrofitting the code in instcombine looks much harder
than just adding a small adjustment here, and this is potentially more
efficient and beneficial to other passes.


Compare: https://github.com/llvm/llvm-project/compare/792be5df92e8...e36d351d19b1


More information about the All-commits mailing list