[all-commits] [llvm/llvm-project] a37861: [InstSimplify] Add tests for simplify `llvm.ptrmas...

goldsteinn via All-commits all-commits at lists.llvm.org
Wed Nov 1 21:50:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a37861d70754688dacdeb6c09db812b6c68b7fb6
      https://github.com/llvm/llvm-project/commit/a37861d70754688dacdeb6c09db812b6c68b7fb6
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    A llvm/test/Transforms/InstSimplify/ptrmask.ll

  Log Message:
  -----------
  [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC

Differential Revision: https://reviews.llvm.org/D156632


  Commit: 8c2fcf5b772ee686b079af75079537d1e4852faf
      https://github.com/llvm/llvm-project/commit/8c2fcf5b772ee686b079af75079537d1e4852faf
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InferAddressSpaces/AMDGPU/ptrmask.ll
    M llvm/test/Transforms/InstCombine/align-addr.ll
    M llvm/test/Transforms/InstSimplify/ptrmask.ll

  Log Message:
  -----------
  [InstSimplify] Add some basic simplifications for `llvm.ptrmask`

Mostly the same as `and`. We also have a check for a useless
`llvm.ptrmask` if the ptr is already known aligned.

Differential Revision: https://reviews.llvm.org/D156633


  Commit: 2c5f2b33aea2ebaa780ca522f3d1007e99c7577e
      https://github.com/llvm/llvm-project/commit/2c5f2b33aea2ebaa780ca522f3d1007e99c7577e
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M llvm/test/Transforms/InstCombine/consecutive-ptrmask.ll
    A llvm/test/Transforms/InstCombine/ptrmask.ll

  Log Message:
  -----------
  [InstCombine] Add tests for combining `llvm.ptrmask`; NFC

Differential Revision: https://reviews.llvm.org/D156634


  Commit: edb9e9a5fb3cae861511f9a11e6d000e8a82fe91
      https://github.com/llvm/llvm-project/commit/edb9e9a5fb3cae861511f9a11e6d000e8a82fe91
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
    M llvm/test/Transforms/InstCombine/ptrmask.ll

  Log Message:
  -----------
  [InstCombine] Implement `SimplifyDemandedBits` for `llvm.ptrmask`

Logic basically copies 'and' but we can't return a constant if the
result == rhs (mask) so that case is skipped.


  Commit: 51abbf98d19cb1b89c6938811f2805bafe4b336e
      https://github.com/llvm/llvm-project/commit/51abbf98d19cb1b89c6938811f2805bafe4b336e
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M clang/test/CodeGen/arm64_32-vaarg.c
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/align-addr.ll
    M llvm/test/Transforms/InstCombine/consecutive-ptrmask.ll
    M llvm/test/Transforms/InstCombine/ptrmask.ll

  Log Message:
  -----------
  [InstCombine] Deduce `align` and `nonnull` return attributes for `llvm.ptrmask`

We can deduce the former based on the mask / incoming pointer
alignment.  We can set the latter based if know the result in non-zero
(this is essentially just caching our analysis result).

Differential Revision: https://reviews.llvm.org/D156636


  Commit: cc8341872d48ed3b7d4c42cac32d68349644c1c1
      https://github.com/llvm/llvm-project/commit/cc8341872d48ed3b7d4c42cac32d68349644c1c1
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/ptrmask.ll

  Log Message:
  -----------
  [InstCombine] Preserve return attributes when merging `llvm.ptrmask`

If we have assosiated attributes i.e `([ret_attrs] (ptrmask (ptrmask
p0, m0), m1))` we should preserve `[ret_attrs]` when combining the two
`llvm.ptrmask`s.

Differential Revision: https://reviews.llvm.org/D156638


  Commit: bd29197fd8448265dbf8e370a8a21a477cd50f5a
      https://github.com/llvm/llvm-project/commit/bd29197fd8448265dbf8e370a8a21a477cd50f5a
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

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

  Log Message:
  -----------
  [InstCombine] Fold `(ptrtoint (ptrmask p0, m0))` -> `(and (ptrtoint p0), m0)`

`and` is generally more supported so if we have a `ptrmask` anyways
might as well use `and`.

Differential Revision: https://reviews.llvm.org/D156640

Closes #67166


Compare: https://github.com/llvm/llvm-project/compare/22aad0ad36a4...bd29197fd844


More information about the All-commits mailing list