[all-commits] [llvm/llvm-project] 57b019: [X86] IsNOT - fold PCMPGT(C, X) -> PCMPGT(X, C-1)

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Sep 27 04:34:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 57b0194b696f8fedb53201430d6db1bec313781c
      https://github.com/llvm/llvm-project/commit/57b0194b696f8fedb53201430d6db1bec313781c
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/fpclamptosat_vec.ll
    M llvm/test/CodeGen/X86/icmp-pow2-diff.ll
    M llvm/test/CodeGen/X86/masked_store_trunc_usat.ll
    M llvm/test/CodeGen/X86/pr48215.ll
    M llvm/test/CodeGen/X86/sat-add.ll
    M llvm/test/CodeGen/X86/vec_setcc-2.ll
    M llvm/test/CodeGen/X86/vector-trunc-usat.ll

  Log Message:
  -----------
  [X86] IsNOT - fold PCMPGT(C, X) -> PCMPGT(X,C-1)

To invert the result, we can profitably commute a PCMPGT node if the LHS was a constant (C > min_signed_value): https://alive2.llvm.org/ce/z/LxcPqm

Allows the constant to fold, and helps reduce register pressure

Fixes #67347




More information about the All-commits mailing list