[all-commits] [llvm/llvm-project] 3af514: [InstCombine] Add tests for improving `sub X, ~Y` ...

goldsteinn via All-commits all-commits at lists.llvm.org
Sun Nov 19 10:15:32 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3af514e5aea2a3e7774c667232ccd0d611cf911a
      https://github.com/llvm/llvm-project/commit/3af514e5aea2a3e7774c667232ccd0d611cf911a
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-19 (Sun, 19 Nov 2023)

  Changed paths:
    M llvm/test/Transforms/InstCombine/fold-sub-of-not-to-inc-of-add.ll

  Log Message:
  -----------
  [InstCombine] Add tests for improving `sub X, ~Y` -> `add X, -Y`; NFC


  Commit: f112e4693a9718ef55019ab4d68ede739b2dca3d
      https://github.com/llvm/llvm-project/commit/f112e4693a9718ef55019ab4d68ede739b2dca3d
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-19 (Sun, 19 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
    M llvm/test/Analysis/ValueTracking/knownbits-and-or-xor-lowbit.ll
    M llvm/test/Transforms/InstCombine/fold-sub-of-not-to-inc-of-add.ll

  Log Message:
  -----------
  [InstCombine] Don't transform `sub X, ~Y` -> `add X, -Y` unless `Y` is actually negatable

This combine was previously adding instruction in some cases (see the
tests).

Closes #72767


  Commit: 160a13a0cc98afc15c08bdeb07bec8f72b04e051
      https://github.com/llvm/llvm-project/commit/160a13a0cc98afc15c08bdeb07bec8f72b04e051
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-19 (Sun, 19 Nov 2023)

  Changed paths:
    M llvm/test/CodeGen/X86/cmp-shiftX-maskX.ll

  Log Message:
  -----------
  [X86] Add more tests for transform `(icmp eq/ne (and X,C0),(shift X,C1))`; PR71598


  Commit: ed7c97e0ad335eec8d65c00d8f963fea3455d4cf
      https://github.com/llvm/llvm-project/commit/ed7c97e0ad335eec8d65c00d8f963fea3455d4cf
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-19 (Sun, 19 Nov 2023)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/test/CodeGen/X86/cmp-shiftX-maskX.ll

  Log Message:
  -----------
  Recommit "[DAGCombiner] Transform `(icmp eq/ne (and X,C0),(shift X,C1))` to use rotate or to getter constants." (2nd Try)

Added missing check that the mask and shift amount added up to correct
bitwidth as well as test cases for the bug.

Closes #71729


  Commit: 0f3a9efcbdc90b9e29dce405ee6c2ac5703fd63f
      https://github.com/llvm/llvm-project/commit/0f3a9efcbdc90b9e29dce405ee6c2ac5703fd63f
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-19 (Sun, 19 Nov 2023)

  Changed paths:
    A llvm/test/Transforms/InstCombine/icmp-of-trunc-ext.ll

  Log Message:
  -----------
  [InstCombine] Add tests for transforming `(icmp eq/ne trunc(x), truncOrZext(y))`; NFC


  Commit: 99387e33dc750b35223a86f59f755d41d8614bd5
      https://github.com/llvm/llvm-project/commit/99387e33dc750b35223a86f59f755d41d8614bd5
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-11-19 (Sun, 19 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/test/Transforms/InstCombine/eq-of-parts.ll
    M llvm/test/Transforms/InstCombine/icmp-of-trunc-ext.ll

  Log Message:
  -----------
  [InstCombine] Add transforms for `(icmp uPred (trunc x),(truncOrZext(y)))`->`(icmp uPred x,y)`

Three transforms (all commutative):
https://alive2.llvm.org/ce/z/Bc-nh4

Closes #71309


Compare: https://github.com/llvm/llvm-project/compare/dfe1d35c629f...99387e33dc75


More information about the All-commits mailing list