Skip to content

[CIR][NFC] Refactor code for populating LLVM conversion patterns #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

Lancern
Copy link
Member

@Lancern Lancern commented Nov 22, 2024

The function populateCIRToLLVMConversionPatterns contains a spaghetti of LLVM dialect conversion patterns, which results in merge conflicts very easily. Besides, a few patterns are even registered for more than once, possibly due to careless resolution of merge conflicts.

This PR attempts to mitigate this problem. Pattern names now are sorted in alphabetical order, and each source code line now only lists exactly one pattern name to reduce potential merge conflicts.

The function `populateCIRToLLVMConversionPatterns` contains a sphagetti of LLVM
dialect conversion patterns, which results in merge conflicts very easily.
Besides, a few patterns are even registered for more than once, possibly due to
careless resolution of merge conflicts.

This patch attempts to mitigate this problem. Pattern names now are sorted in
alphabetical order, and each source code line now only lists exactly one pattern
name to reduce potential merge conflicts.
Copy link
Collaborator

@seven-mile seven-mile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice💘

Copy link
Collaborator

@smeenai smeenai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@smeenai smeenai merged commit dbd3e03 into llvm:main Nov 22, 2024
7 checks passed
@Lancern Lancern deleted the lowering-patterns branch November 22, 2024 06:14
smeenai pushed a commit that referenced this pull request Nov 22, 2024
The function `populateCIRToLLVMConversionPatterns` contains a spaghetti
of LLVM dialect conversion patterns, which results in merge conflicts
very easily. Besides, a few patterns are even registered for more than
once, possibly due to careless resolution of merge conflicts.

This PR attempts to mitigate this problem. Pattern names now are sorted
in alphabetical order, and each source code line now only lists exactly
one pattern name to reduce potential merge conflicts.
lanza pushed a commit that referenced this pull request Mar 18, 2025
The function `populateCIRToLLVMConversionPatterns` contains a spaghetti
of LLVM dialect conversion patterns, which results in merge conflicts
very easily. Besides, a few patterns are even registered for more than
once, possibly due to careless resolution of merge conflicts.

This PR attempts to mitigate this problem. Pattern names now are sorted
in alphabetical order, and each source code line now only lists exactly
one pattern name to reduce potential merge conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants