Skip to content

feat(dataflow): sparse conditional constant propagation analysis (sccp) - #456

Draft
axelcool1234 wants to merge 4 commits into
opencompl:mainfrom
axelcool1234:sccp
Draft

feat(dataflow): sparse conditional constant propagation analysis (sccp)#456
axelcool1234 wants to merge 4 commits into
opencompl:mainfrom
axelcool1234:sccp

Conversation

@axelcool1234

Copy link
Copy Markdown
Collaborator

This implements SCCP analysis on top of the dataflow framework: #264

WIP: Creating a transformation using this analysis. Should be simple to do.

@axelcool1234
axelcool1234 force-pushed the sccp branch 4 times, most recently from af2679c to a38547b Compare April 23, 2026 01:34
@axelcool1234
axelcool1234 force-pushed the sccp branch 4 times, most recently from 3273e24 to 81e9036 Compare May 4, 2026 05:11
@axelcool1234
axelcool1234 force-pushed the sccp branch 14 times, most recently from fae78c9 to 85e0bbb Compare May 8, 2026 06:59
@axelcool1234
axelcool1234 force-pushed the sccp branch 5 times, most recently from 2a55b12 to 1c90b24 Compare May 19, 2026 06:08
alexanderlhicks pushed a commit to alexanderlhicks/veir that referenced this pull request May 20, 2026
The following is a dataflow analysis framework based off the C++ MLIR
implementation.

An analysis I've implemented on top of the framework is SCCP:
opencompl#456
@axelcool1234
axelcool1234 force-pushed the sccp branch 8 times, most recently from 164ef6f to 7153e4f Compare June 12, 2026 06:57
@axelcool1234 axelcool1234 changed the title Sparse Conditional Constant Propagation Analysis (SCCP) feat(dataflow): sparse conditional constant propagation analysis (sccp) Jun 12, 2026
@axelcool1234
axelcool1234 force-pushed the sccp branch 8 times, most recently from 9008b8f to 769c027 Compare June 14, 2026 00:06
@tobiasgrosser

Copy link
Copy Markdown
Collaborator

@axelcool1234, this seems outdated. I close this for now. @axelcool1234, please reopen if you still plan to move for forward.

@axelcool1234

Copy link
Copy Markdown
Collaborator Author

@axelcool1234, this seems outdated. I close this for now. @axelcool1234, please reopen if you still plan to move for forward.

This is what all of my PRs in the dataflow analysis builds up to. I've been keeping it up to date as my PRs this is stacked on are changed and merged. I don't know if I have the permissions to reopen it as a draft

@axelcool1234

axelcool1234 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

What I need to do is figure out how to use GitHub's new stacked PR feature so this is apparent

@axelcool1234

Copy link
Copy Markdown
Collaborator Author

I apologize for how long this has taken. I've just been busy with my internship and all. I'll be ramping up my involvement come next week when I finish my time at AMD. @tobiasgrosser

@tobiasgrosser

Copy link
Copy Markdown
Collaborator

Sorry, then I was too eager.

@axelcool1234

axelcool1234 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

Sorry, then I was too eager.

No it's okay this has been open for a whopping 3 months so I get it. SCCP required the dataflow analysis framework, an interface for abstract domains, dead code analysis, constant propagation analysis, and a sparse forward analysis API in order to work. I have most of these things merged into VeIR now. Just the sparse forward analysis API and constant propagation analysis is left :)

@regehr

regehr commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

@axelcool1234 all good but yes-- please mark things as drafts unless they're actually in a state where others should be looking at them

@axelcool1234

Copy link
Copy Markdown
Collaborator Author

@axelcool1234 all good but yes-- please mark things as drafts unless they're actually in a state where others should be looking at them

It was a draft

@axelcool1234

axelcool1234 commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

@tobiasgrosser

What I'm currently working on or will work on which leads to this PR opening:

  • currently devising an overhaul to the control flow interface in VeIR. This'll provide some important features of the interface to dead code analysis, which will fix it - it currently uses a hard coded set of functions that fails for certain dialects
  • need to make the sparse forward dataflow analysis API refer to dead code analysis if it's turned on

Once these two are resolved, and assuming nothing comes up, the sparse forward dataflow analysis API can be merged. And once that merges that opens up constant propagation to be looked over. It needs to be rewritten now that there's a constant folder.

Once constant propagation is properly rewritten and merged, this PR is ready to open, which basically makes some tweaks to dead code analysis to use constant propagation if it's - enabled.

When dead code uses constant propagation if enabled, and vice versa, we have SCCP!

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