[all-commits] [llvm/llvm-project] 2e3de9: [DAG] Generalize setcc(setcc) fold to use known bits.

David Green via All-commits all-commits at lists.llvm.org
Tue Feb 6 04:40:02 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e3de997ab7cd8728c484bc39e24fecbb97dfae8
      https://github.com/llvm/llvm-project/commit/2e3de997ab7cd8728c484bc39e24fecbb97dfae8
  Author: David Green <david.green at arm.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/AArch64/setcc_knownbits.ll
    M llvm/test/CodeGen/WebAssembly/xor_reassociate.ll
    M llvm/test/CodeGen/X86/lzcnt-cmp.ll
    M llvm/test/CodeGen/X86/umul_fix_sat.ll
    M llvm/test/CodeGen/X86/xor.ll

  Log Message:
  -----------
  [DAG] Generalize setcc(setcc) fold to use known bits.

If we have a `SETCC (SETCC), 0, NE` and ZeroOrOneBooleanContent, we can remove
the outer setcc as it will produce the same value as the inner. This can be
generalized to anything where the top bits are known to be 0, as the value will
remain as 1 or 0.




More information about the All-commits mailing list