[all-commits] [llvm/llvm-project] c8cba0: [InstCombine] add tests for add-of-extends; NFC

Sanjay Patel via All-commits all-commits at lists.llvm.org
Tue Dec 13 12:55:22 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8cba0bc4a8c9f4f3f10e17f601ed924dfb82bef
      https://github.com/llvm/llvm-project/commit/c8cba0bc4a8c9f4f3f10e17f601ed924dfb82bef
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstCombine/add.ll

  Log Message:
  -----------
  [InstCombine] add tests for add-of-extends; NFC


  Commit: 7520d187cf0dedcf5085f71bc1a5472c75cc8dbb
      https://github.com/llvm/llvm-project/commit/7520d187cf0dedcf5085f71bc1a5472c75cc8dbb
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstCombine/add.ll

  Log Message:
  -----------
  [ValueTracking] peek through extends in haveNoCommonBitsSet

In cases with matching extends, this allows changing an 'add'
into an 'or' and narrowing the 'or' which then simplifies to
a constant.

In cases with opposite extends, we just convert to an 'or'
currently, but that could be reduced too.

https://alive2.llvm.org/ce/z/fTHzdb


Compare: https://github.com/llvm/llvm-project/compare/65f4cc63102a...7520d187cf0d


More information about the All-commits mailing list