[all-commits] [llvm/llvm-project] b6aaa8: [NFC][CVP] Add `@llvm.abs` test cases

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sat Apr 10 06:48:01 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b6aaa8836ee0f8a6ec13319bf26523ec73cdbed4
      https://github.com/llvm/llvm-project/commit/b6aaa8836ee0f8a6ec13319bf26523ec73cdbed4
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-10 (Sat, 10 Apr 2021)

  Changed paths:
    A llvm/test/Transforms/CorrelatedValuePropagation/abs.ll

  Log Message:
  -----------
  [NFC][CVP] Add `@llvm.abs` test cases


  Commit: c329a47d9ed77512493f787520317e3f51be3387
      https://github.com/llvm/llvm-project/commit/c329a47d9ed77512493f787520317e3f51be3387
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-10 (Sat, 10 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
    M llvm/test/Transforms/CorrelatedValuePropagation/abs.ll
    M llvm/test/Transforms/CorrelatedValuePropagation/minmaxabs.ll

  Log Message:
  -----------
  [CVP] @llvm.abs() handling

Iff we know the sigdness domain of the argument,
we can either skip @llvm.abs, or do negation directly.

Notably, INT_MIN can belong to either domain:
* X u<= INT_MIN --> X  is always fine
  https://alive2.llvm.org/ce/z/QB8j-C https://alive2.llvm.org/ce/z/7sFKpS
* X s<= 0 --> -X  is always fine
  https://alive2.llvm.org/ce/z/QbGSyq https://alive2.llvm.org/ce/z/APsN84

If all else fails, try to inferr NSW flag:
https://alive2.llvm.org/ce/z/qCJfYm


Compare: https://github.com/llvm/llvm-project/compare/71ab6c98a0d1...c329a47d9ed7


More information about the All-commits mailing list