[all-commits] [llvm/llvm-project] 3d852d: [NFC][PhaseOrdering] Re-autogenerate check lines i...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Dec 30 08:41:23 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d852d1e74fb039bbceded174edd548e80b6d79b
      https://github.com/llvm/llvm-project/commit/3d852d1e74fb039bbceded174edd548e80b6d79b
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-12-30 (Fri, 30 Dec 2022)

  Changed paths:
    M llvm/test/Transforms/PhaseOrdering/cmp-logic.ll

  Log Message:
  -----------
  [NFC][PhaseOrdering] Re-autogenerate check lines in one test


  Commit: 36cb258cdf940e539db2bbc8737c57ee94fb8d5d
      https://github.com/llvm/llvm-project/commit/36cb258cdf940e539db2bbc8737c57ee94fb8d5d
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-12-30 (Fri, 30 Dec 2022)

  Changed paths:
    A llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll

  Log Message:
  -----------
  [NFC][CVP] Add tests for urem expansion


  Commit: 3cb827f9d3e9c502a1a08f1de1980e906aa30c3d
      https://github.com/llvm/llvm-project/commit/3cb827f9d3e9c502a1a08f1de1980e906aa30c3d
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-12-30 (Fri, 30 Dec 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp

  Log Message:
  -----------
  [NFC][CVP] `processURem()`: add statistic and increase readability


  Commit: 66efb986322b206834e7c9e1eb777fa053912c39
      https://github.com/llvm/llvm-project/commit/66efb986322b206834e7c9e1eb777fa053912c39
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-12-30 (Fri, 30 Dec 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
    M llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll
    M llvm/test/Transforms/CorrelatedValuePropagation/urem.ll
    M llvm/test/Transforms/PhaseOrdering/cmp-logic.ll

  Log Message:
  -----------
  [CVP] Expand bound `urem`s

This kind of thing happens really frequently in LLVM's very own
shuffle combining methods, and it is even considered bad practice
to use `%` there, instead of using this expansion directly.
Though, many of the cases there have variable divisors,
so this won't help everything.

Simple case: https://alive2.llvm.org/ce/z/PjvYf-
There's alternative expansion via `umin`:
https://alive2.llvm.org/ce/z/hWCVPb

BUT while we can transform the first expansion
into the `umin` one (e.g. for SCEV):
https://alive2.llvm.org/ce/z/iNxKmJ
... we can't go in the opposite direction.

Also, the non-`umin` expansion seems somewhat more codegen-friendly:
https://godbolt.org/z/qzjx5bqWK
https://godbolt.org/z/a7bj1axbx

There's second variant of precondition:
https://alive2.llvm.org/ce/z/zE6cbM
but there the numerator must be non-undef / must be frozen.


Compare: https://github.com/llvm/llvm-project/compare/7e720b010a19...66efb986322b


More information about the All-commits mailing list