[all-commits] [llvm/llvm-project] 3e73a0: [X86] Add tests for folding `(icmp ult (add x, -C), ...

goldsteinn via All-commits all-commits at lists.llvm.org
Thu Mar 7 11:12:38 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e73a080fa23594c81ad1dc61a65a11c9c488c5b
      https://github.com/llvm/llvm-project/commit/3e73a080fa23594c81ad1dc61a65a11c9c488c5b
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2024-03-07 (Thu, 07 Mar 2024)

  Changed paths:
    A llvm/test/CodeGen/X86/eq-or-eq-range-of-2.ll

  Log Message:
  -----------
  [X86] Add tests for folding `(icmp ult (add x,-C),2)` -> `(or (icmp eq X,C), (icmp eq X,C+1))`; NFC


  Commit: 9f96db8e310f79ec450c9cf6e6311f576dfd1d51
      https://github.com/llvm/llvm-project/commit/9f96db8e310f79ec450c9cf6e6311f576dfd1d51
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2024-03-07 (Thu, 07 Mar 2024)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/eq-or-eq-range-of-2.ll

  Log Message:
  -----------
  [X86] Fold `(icmp ult (add x,-C),2)` -> `(or (icmp eq X,C), (icmp eq X,C+1))` for Vectors

This is undoing a middle-end transform which does the opposite. Since
X86 doesn't have unsigned vector comparison instructions pre-AVX512,
the simplified form gets worse codegen.

Fixes #66479

Proofs: https://alive2.llvm.org/ce/z/UCz3wt

Closes #84104
Closes #66479


Compare: https://github.com/llvm/llvm-project/compare/fc837f7a2dbd...9f96db8e310f

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list