[all-commits] [llvm/llvm-project] 001892: [DAG] add (~a | x) & (a | y) -> (a & (x ^ y)) ^y f...

woruyu via All-commits all-commits at lists.llvm.org
Wed Jun 18 09:23:14 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 00189211486d052b25429f11790ef5486cf9d3ce
      https://github.com/llvm/llvm-project/commit/00189211486d052b25429f11790ef5486cf9d3ce
  Author: woruyu <99597449+woruyu at users.noreply.github.com>
  Date:   2025-06-18 (Wed, 18 Jun 2025)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    A llvm/test/CodeGen/X86/fold-masked-merge-demorgan.ll

  Log Message:
  -----------
  [DAG] add (~a | x) & (a | y) -> (a & (x ^ y)) ^y for foldMaskedMerge (#144342)

### Summary
This PR resolves https://github.com/llvm/llvm-project/issues/143864

Add (~a | x) & (a | y) -> (a & (x ^ y)) ^y for foldMaskedMerge func
using SDPatternMatch

aftering adding this pattern, run ```ninja check-llvm-codegen```, all
other cases remain unchanged, so I add a
testcase(fold-masked-merge-demorgan.ll) for it

---------

Co-authored-by: Simon Pilgrim <llvm-dev at redking.me.uk>



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