[all-commits] [llvm/llvm-project] 26f79e: [NFC][InstCombine] Tests for negation of `add` w/ ...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Wed Aug 5 10:02:09 PDT 2020


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

  Changed paths:
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll

  Log Message:
  -----------
  [NFC][InstCombine] Tests for negation of `add` w/ single negatible operand


  Commit: 3a3c9519e272e664172a0a90e8abf84b6d400106
      https://github.com/llvm/llvm-project/commit/3a3c9519e272e664172a0a90e8abf84b6d400106
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-05 (Wed, 05 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll
    M llvm/test/Transforms/InstCombine/sub.ll

  Log Message:
  -----------
  [InstCombine] Negator: 0 - (X + Y)  -->  (-X) - Y  iff a single operand negated

This was the most obvious regression in
f5df5cd5586ae9cfb2d9e53704dfc76f47aff149.f5df5cd5586ae9cfb2d9e53704dfc76f47aff149

We really don't want to do this if the original/outermost subtraction
isn't a negation, and therefore doesn't go away - just sinking negation
isn't a win. We are actually appear to be missing folds so hoist it.

https://rise4fun.com/Alive/tiVe


Compare: https://github.com/llvm/llvm-project/compare/719954eacb70...3a3c9519e272


More information about the All-commits mailing list