[all-commits] [llvm/llvm-project] f6fc3e: [InstCombine] refactor matching code for logical a...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Fri Oct 21 08:28:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f6fc3e23b95ef0045d4453bd3fdddd765f29099b
      https://github.com/llvm/llvm-project/commit/f6fc3e23b95ef0045d4453bd3fdddd765f29099b
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp

  Log Message:
  -----------
  [InstCombine] refactor matching code for logical ands; NFCI

Separating the matches makes it easier
to enhance for commutative patterns.


  Commit: d7fecf26f42b47f5c2e7e64a2975ec0dcccd7248
      https://github.com/llvm/llvm-project/commit/d7fecf26f42b47f5c2e7e64a2975ec0dcccd7248
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/select-safe-transforms.ll

  Log Message:
  -----------
  [InstCombine] allow some commutative matches for logical-and to select fold

This is obviously correct for real logic instructions,
and it also works for the poison-safe variants that use
selects:
https://alive2.llvm.org/ce/z/wyHiwX

This is motivated by the lack of 'xor' folding seen in issue #58313.
This more general fold should help reduce some of those patterns,
but I'm not sure if this specific case does anything for that
particular example.


Compare: https://github.com/llvm/llvm-project/compare/2c0d0566ee2d...d7fecf26f42b


More information about the All-commits mailing list