[all-commits] [llvm/llvm-project] e3e9c9: [X86][AArch64][RISCV] Add tests for combining `(se...

goldsteinn via All-commits all-commits at lists.llvm.org
Thu Sep 28 11:47:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e3e9c94006103a32f28f9a9e10ee72986d3159fc
      https://github.com/llvm/llvm-project/commit/e3e9c94006103a32f28f9a9e10ee72986d3159fc
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-09-28 (Thu, 28 Sep 2023)

  Changed paths:
    A llvm/test/CodeGen/AArch64/select-to-and-zext.ll
    A llvm/test/CodeGen/RISCV/select-to-and-zext.ll
    A llvm/test/CodeGen/X86/select-to-and-zext.ll

  Log Message:
  -----------
  [X86][AArch64][RISCV] Add tests for combining `(select c, (and X, 1), 0)` -> `(and (zext c), X)`; NFC


  Commit: de7881ebf5e112f978940cbff5582c19fab90eb1
      https://github.com/llvm/llvm-project/commit/de7881ebf5e112f978940cbff5582c19fab90eb1
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-09-28 (Thu, 28 Sep 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AArch64/select-to-and-zext.ll
    M llvm/test/CodeGen/RISCV/select-to-and-zext.ll
    M llvm/test/CodeGen/SystemZ/pr60413.ll
    M llvm/test/CodeGen/X86/select-to-and-zext.ll

  Log Message:
  -----------
  [DAGCombiner] Combine `(select c, (and X, 1), 0)` -> `(and (zext c), X)`

The middle end canonicalizes:
`(and (zext c), X)`
    -> `(select c, (and X, 1), 0)`

But the `and` + `zext` form gets better codegen.


Compare: https://github.com/llvm/llvm-project/compare/720e3bacbd9f...de7881ebf5e1


More information about the All-commits mailing list