Skip to content

Add integer sign inference analysis pass#807

Closed
shaobo-he wants to merge 1 commit intodevelopfrom
sign-analysis
Closed

Add integer sign inference analysis pass#807
shaobo-he wants to merge 1 commit intodevelopfrom
sign-analysis

Conversation

@shaobo-he
Copy link
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.

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>
@shaobo-he shaobo-he closed this Mar 14, 2026
@shaobo-he shaobo-he deleted the sign-analysis branch March 14, 2026 03:07
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