[all-commits] [llvm/llvm-project] 92c5bc: [InstCombine] add tests for zext of and of trunc; NFC

Sanjay Patel via All-commits all-commits at lists.llvm.org
Sun Nov 6 06:07:31 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 92c5bcb7bce77ba2b9612169cab12fa52737e15a
      https://github.com/llvm/llvm-project/commit/92c5bcb7bce77ba2b9612169cab12fa52737e15a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-11-06 (Sun, 06 Nov 2022)

  Changed paths:
    M llvm/test/Transforms/InstCombine/zext.ll

  Log Message:
  -----------
  [InstCombine] add tests for zext of and of trunc; NFC

The basic one-use version of this sequence is reduced,
but we don't transform these currently.


  Commit: 1c6ebe29d3c03382a62985fab764f5641db7f875
      https://github.com/llvm/llvm-project/commit/1c6ebe29d3c03382a62985fab764f5641db7f875
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-11-06 (Sun, 06 Nov 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/test/Transforms/InstCombine/zext.ll

  Log Message:
  -----------
  [InstCombine] reduce multi-use casts+masks

As noted in the code comment, we could generalize this:
https://alive2.llvm.org/ce/z/N5m-eZ

It saves an instruction even without a constant operand,
but the 'and' is wider. We can do that as another step
if it doesn't harm anything.

I noticed that this missing pattern with a constant operand
inhibited other transforms in a recent bug report, so this
is enough to solve that case.


  Commit: bff6880a5f890b8d01d9de26d3482d3a145157c0
      https://github.com/llvm/llvm-project/commit/bff6880a5f890b8d01d9de26d3482d3a145157c0
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-11-06 (Sun, 06 Nov 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp

  Log Message:
  -----------
  [SimplifyLibCalls] improve code readability for AttributeList propagation; NFC

It is possible that we can do better on some of these transforms
by passing some subset of attributes, but we were not doing that
in any of the changed code. So it's better to give that a name
to indicate we're clearing attributes or make that more obvious
by using the default-constructed empty list.


Compare: https://github.com/llvm/llvm-project/compare/08fe55b346cb...bff6880a5f89


More information about the All-commits mailing list