[all-commits] [llvm/llvm-project] 664e17: [NFC][InstCombine] Add tests for comparisons betwe...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Thu Aug 6 01:51:51 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 664e1784cd5ee742d74a95a018986e02d66908eb
      https://github.com/llvm/llvm-project/commit/664e1784cd5ee742d74a95a018986e02d66908eb
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    A llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [NFC][InstCombine] Add tests for comparisons between x and negation of x (PR39480)


  Commit: 5060f5682b011d2a8c708b3c1b16bd4e0c408afb
      https://github.com/llvm/llvm-project/commit/5060f5682b011d2a8c708b3c1b16bd4e0c408afb
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/include/llvm/IR/PatternMatch.h
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) s> x  --> x s< 0  (PR39480)

Name: (-x) s> x  -->  x s< 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp sgt i8 %neg_x, %x
  =>
%r = icmp slt i8 %x, 0

https://rise4fun.com/Alive/ZslD

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: 8878b79cfe99e1ef36a265539329cd323e05a40d
      https://github.com/llvm/llvm-project/commit/8878b79cfe99e1ef36a265539329cd323e05a40d
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) ==/!= x  --> x ==/!= 0  (PR39480)

Name: (-x) == x  -->  x == 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp eq i8 %neg_x, %x
  =>
%r = icmp eq i8 %x, 0

Name: (-x) != x  -->  x != 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp ne i8 %neg_x, %x
  =>
%r = icmp ne i8 %x, 0

https://rise4fun.com/Alive/4slH

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: 388520765157f1ce7e48e49179dc58781ae61f56
      https://github.com/llvm/llvm-project/commit/388520765157f1ce7e48e49179dc58781ae61f56
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) s>= x  --> x s<= 0  (PR39480)

Name: (-x) s>= x  -->  x s<= 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp sge i8 %neg_x, %x
  =>
%r = icmp sle i8 %x, 0

https://rise4fun.com/Alive/Hdip

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: 01a6c4bd26a599e877301568f77eb835d0a6e812
      https://github.com/llvm/llvm-project/commit/01a6c4bd26a599e877301568f77eb835d0a6e812
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) s< x  --> x s> 0  (PR39480)

Name: (-x) s< x  -->  x > 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp slt i8 %neg_x, %x
  =>
%r = icmp sgt i8 %x, 0

https://rise4fun.com/Alive/3IXb

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: 59387c0dd742be037a0393e8fef7fdffdbb84ec4
      https://github.com/llvm/llvm-project/commit/59387c0dd742be037a0393e8fef7fdffdbb84ec4
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) s<= x  --> x s>= 0  (PR39480)

Name: (-x) s<= x  -->  x >= 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp sle i8 %neg_x, %x
  =>
%r = icmp sge i8 %x, 0

https://rise4fun.com/Alive/91k

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: 16c642fa39d50dd066e364e0f258140a3dbaa64b
      https://github.com/llvm/llvm-project/commit/16c642fa39d50dd066e364e0f258140a3dbaa64b
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) u> x  --> x s> 0  (PR39480)

Name: (-x) u> x  -->  x s> 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp ugt i8 %neg_x, %x
  =>
%r = icmp sgt i8 %x, 0

https://rise4fun.com/Alive/Raea

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: 0e1241a3c9881d5cb3280bdb0c36712fae957694
      https://github.com/llvm/llvm-project/commit/0e1241a3c9881d5cb3280bdb0c36712fae957694
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) u>= x  --> x s>= 0  (PR39480)

Name: (-x) u>= x  -->  x s>= 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp uge i8 %neg_x, %x
  =>
%r = icmp sge i8 %x, 0

https://rise4fun.com/Alive/LLHd

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: 132be1f502778ea8abd5f214908fc19d8535d786
      https://github.com/llvm/llvm-project/commit/132be1f502778ea8abd5f214908fc19d8535d786
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) u< x  --> x s< 0  (PR39480)

Name: (-x) u< x  -->  x s< 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp ult i8 %neg_x, %x
  =>
%r = icmp slt i8 %x, 0

https://rise4fun.com/Alive/zSuf

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: 141357663e671636392c9973025ea723f423a9c4
      https://github.com/llvm/llvm-project/commit/141357663e671636392c9973025ea723f423a9c4
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll

  Log Message:
  -----------
  [InstCombine] (-NSW x) u<= x  --> x s<=0  (PR39480)

Name: (-x) u<= x  -->  x s<= 0
%neg_x = sub nsw i8 0, %x ; %x must not be INT_MIN
%r = icmp ule i8 %neg_x, %x
  =>
%r = icmp sle i8 %x, 0

https://rise4fun.com/Alive/V22

https://bugs.llvm.org/show_bug.cgi?id=39480


  Commit: a512c894768ba681721cb2fc5159294cec810f0a
      https://github.com/llvm/llvm-project/commit/a512c894768ba681721cb2fc5159294cec810f0a
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

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

  Log Message:
  -----------
  [NFC][InstCombine] Refactor '(-NSW x) pred x' fold


Compare: https://github.com/llvm/llvm-project/compare/710949482edb...a512c894768b


More information about the All-commits mailing list