[all-commits] [llvm/llvm-project] e679ee: [InstCombine] add tests for abs(sext X); NFC

RotateRight via All-commits all-commits at lists.llvm.org
Fri Jan 22 10:44:46 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e679eea6d20d6e6e749525827c95f42bfef16285
      https://github.com/llvm/llvm-project/commit/e679eea6d20d6e6e749525827c95f42bfef16285
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-01-22 (Fri, 22 Jan 2021)

  Changed paths:
    M llvm/test/Transforms/InstCombine/abs-intrinsic.ll

  Log Message:
  -----------
  [InstCombine] add tests for abs(sext X); NFC

https://llvm.org/PR48816


  Commit: 411c144e4c99f4d4370ed2b9c248dc6bb9a39648
      https://github.com/llvm/llvm-project/commit/411c144e4c99f4d4370ed2b9c248dc6bb9a39648
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-01-22 (Fri, 22 Jan 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/abs-1.ll
    M llvm/test/Transforms/InstCombine/abs-intrinsic.ll

  Log Message:
  -----------
  [InstCombine] narrow abs with sign-extended input

In the motivating cases from https://llvm.org/PR48816 ,
we have a trailing trunc. But that is not required to
reduce the abs width:
https://alive2.llvm.org/ce/z/ECaz-p
...as long as we clear the int-min-is-poison bit (nsw).

We have some existing tests that are affected, and I'm
not sure what the overall implications are, but in general
we favor narrowing operations over preserving nsw/nuw.

If that causes problems, we could restrict this transform
based on type (shouldChangeType() and/or vector vs. scalar).

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


Compare: https://github.com/llvm/llvm-project/compare/e27197f36054...411c144e4c99


More information about the All-commits mailing list