Skip to content
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

[CombToAIG] Add a lowering for Add/Sub #7968

Merged
merged 5 commits into from
Dec 13, 2024
Merged

Conversation

uenoku
Copy link
Member

@uenoku uenoku commented Dec 11, 2024

This implements a pattern to lower AddOp to a naive ripple-carry adder.
Pattern for sub is also added since we can easily compute subtraction from addition.

This PR also adds a test-only option to additional-legal-ops to test
complicated lowering pattern.

```
c ? a : b => (replicate(c) & a) | (~replicate(c) & b)
```

Add a LEC test for CombToAIG.
Some variadic operations (xor, add, mul etc) cannot directly lowered
into varidic AIG operations. So this adds a pattern to pre-lower variadic
operations.
@uenoku uenoku force-pushed the dev/hidetou/comb-to-aig-add branch from 9e0d671 to bb259ea Compare December 12, 2024 18:15
@uenoku uenoku changed the title [CombToAIG] Add a lowering for AddOp [CombToAIG] Add a lowering for Add/Sub Dec 12, 2024
This implements a pattern to lower AddOp to a naive ripple-carry adder.
Pattern for sub is also added since we can easily compute subtraction from addition.

This PR also adds a test-only option to `additional-legal-ops` to test
complicated lowering pattern.
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

Some questions about additional-legal-ops, but the core lowering looks good to me. This is pretty neat!

include/circt/Conversion/Passes.td Outdated Show resolved Hide resolved
@uenoku uenoku force-pushed the dev/hidetou/comb-to-aig-add branch from bb259ea to 16d3da8 Compare December 12, 2024 22:37
@uenoku uenoku changed the base branch from dev/hidetou/variadic to main December 13, 2024 08:28
@uenoku uenoku merged commit 6634b2b into main Dec 13, 2024
4 checks passed
@uenoku uenoku deleted the dev/hidetou/comb-to-aig-add branch December 13, 2024 09:14
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.

2 participants