Skip to content

Add integer sign inference analysis pass#808

Open
shaobo-he wants to merge 3 commits intodevelopfrom
sign-analysis
Open

Add integer sign inference analysis pass#808
shaobo-he wants to merge 3 commits intodevelopfrom
sign-analysis

Conversation

@shaobo-he
Copy link
Copy Markdown
Contributor

Introduce SignAnalysis, a module pass that infers the sign (signed/unsigned) of integer SSA values via bidirectional dataflow over a four-point lattice. The analysis propagates constraints from sign-carrying operations (sdiv, zext, signed comparisons, nsw/nuw flags), through memory via sea-dsa alias info, and across function boundaries via call/return edges. SmackRep::lit() now queries SignAnalysis to decide constant rendering, falling back to the previous heuristic when the analysis returns Unknown or Conflict.

shaobo-he and others added 2 commits March 13, 2026 20:09
Introduce SignAnalysis, a module pass that infers the sign (signed/unsigned)
of integer SSA values via bidirectional dataflow over a four-point lattice.
The analysis propagates constraints from sign-carrying operations (sdiv, zext,
signed comparisons, nsw/nuw flags), through memory via sea-dsa alias info,
and across function boundaries via call/return edges. SmackRep::lit() now
queries SignAnalysis to decide constant rendering, falling back to the
previous heuristic when the analysis returns Unknown or Conflict.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shaobo-he shaobo-he requested a review from keram88 March 14, 2026 07:46
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.

1 participant