Skip to content

Fix wrong op match in peephole optimization#322

Open
tobiichi3227 wants to merge 1 commit intosysprog21:masterfrom
tobiichi3227:fix/peephole
Open

Fix wrong op match in peephole optimization#322
tobiichi3227 wants to merge 1 commit intosysprog21:masterfrom
tobiichi3227:fix/peephole

Conversation

@tobiichi3227
Copy link
Copy Markdown
Contributor

@tobiichi3227 tobiichi3227 commented Apr 10, 2026

Summary by cubic

Fixes the peephole optimization to correctly detect and fold a double bitwise NOT. The rule now reduces ~(~x) to x without hitting the arithmetic negate path.

  • Bug Fixes
    • Match OP_bit_not (not OP_negate) for the "~(~x) => x" rule to prevent incorrect transforms.

Written for commit 32ba47a. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

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