Skip to content

[DAG] foldMaskedMerge - add (~a | x) & (a | y) -> (a & (x ^ y)) ^y fold #143864

@RKSimon

Description

@RKSimon
Collaborator

Once #143855 is complete, we can add handling for the demorgan equivalent pattern (~a | x) & (a | y)

Activity

llvmbot

llvmbot commented on Jun 12, 2025

@llvmbot
Member

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor is working on this issue. If someone is assigned to the issue or claimed to be working on it, ping the person. After one week without a response, the assignee may be changed.
  2. Leave a comment indicating that you are working on the issue, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

llvmbot

llvmbot commented on Jun 12, 2025

@llvmbot
Member

@llvm/issue-subscribers-good-first-issue

Author: Simon Pilgrim (RKSimon)

Once #143855 is complete, we can add handling for the demorgan equivalent pattern (~a | x) & (a | y)
RKSimon

RKSimon commented on Jun 12, 2025

@RKSimon
CollaboratorAuthor
woruyu

woruyu commented on Jun 12, 2025

@woruyu
Member

hello, @RKSimon , I would like to go on working for this issue? Any suggestion!

RKSimon

RKSimon commented on Jun 12, 2025

@RKSimon
CollaboratorAuthor

Start with adding the equivalent sd_match pattern to foldMaskedMerge and seeing if anything in ninja check-llvm-codegen already improves, but I expect you will have to add additional test coverage

woruyu

woruyu commented on Jun 16, 2025

@woruyu
Member

Added pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issuehttps://github.com/llvm/llvm-project/contributellvm:SelectionDAGSelectionDAGISel as well

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @RKSimon@llvmbot@woruyu

    Issue actions

      [DAG] foldMaskedMerge - add (~a | x) & (a | y) -> (a & (x ^ y)) ^y fold · Issue #143864 · llvm/llvm-project