Support for SSA Transformation in Chiron and Sparse Simple Constant Propagation#20
Open
sarthak-motwani wants to merge 2 commits into
Open
Support for SSA Transformation in Chiron and Sparse Simple Constant Propagation#20sarthak-motwani wants to merge 2 commits into
sarthak-motwani wants to merge 2 commits into
Conversation
lahiri-phdworks
self-requested a review
April 25, 2025 11:06
Collaborator
|
@sarthak-motwani Thanks for the PR. I shall review it and add it to the branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template for Feature Additions.
Brief description feature
Provide the details of the feature, explain it's functionality.
Example
Give a test case and related commands that show the utility of the feature.
Running an example
Note: Use the
--irflag to see the new IR printed in the terminal. Also, use the-cfg_genand-cfg_dumpflags to dump the CFG for the original IR.To perform SSA transformation, use the
-ssaflag. (Note: If you are using the-rflag (also runs the program), the program may throw an errorat a phi-instruction since it cannot be interpreted. So, you can run the program without
-rflag).To perform out-of-SSA transformation (after SSA transformation), use
-outssaflag with the-ssaflag.To perform SSCP optimization (after SSA transformation), use
-ssa-sscpand-outssaflags.The testcases are present in the
demo_testcasesdirectory within ChironCore. More examples are present in theexampledirectory.Testing SSA Transformation
cfg0.pngshows the CFG before transformation.cfg2_old_after_rename.pngshows the CFG after SSA renaming (before IR updates).cfg3_new_post_ssa.pngshows the CFG rebuilt from the SSA-transformed IR.Testing Out-of-SSA Tranformation
cfg4_old_out_of_ssa.pngshows the CFG after Out-of-SSA transformation (before IR updates).cfg5_new_out_of_ssa.pngshows the CFG rebuilt from the Out-of-SSA transformed IR.Testing SSCP Optimization
cfg6_new_sscp.pngshows the CFG after SSCP optimization, but before out-of-SSARunning the program with (SSA + out-of-SSA + with or without SSCP) and without any transformation should produce identical outputs.
$ cd ChironCore $ ./chiron.py -r ./demo_testcases/4_nestedloops.tl -cfg_gen -cfg_dump --ir -ssa -outssa -sscpThe below example is shown for clarity. If the user wants to test a complex and large CFG with multiple levels of nesting on loops and if-else, please test
7_verybigprogram.tlwithindemo_testcases. There are other large examples withinexamplefolder as well.Example 1: Showing SSA and out-of-SSA:
CFG Before SSA
CFG After SSA
IR After SSA
CFG After out-of-SSA
IR After out-of-SSA
Output of the program before any transformation
Output of the program after SSA + out-of-SSA (Identical)
Example 2: SSA, out-of-SSA and SSCP optimization
CFG (before any transformation or optimization)
CFG (After SSA)
Lattice Values of all variables
CFG (After SSA + out-of-SSA + SSCP)
IR (After SSA + out-of-SSA + SSCP)
Please add a atleast 3 test cases to the repository which shows how the feature works and what are the outcomes.
Why is the feature interesting?
Give use cases for the feature.
Screenshots
Please add screenshots whenever possible.
Added.Other Details
Please add additional details that you want the developers to be aware of about the feature. Eg. good use cases (if any).