-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stringify ast #3
Draft
probably-neb
wants to merge
112
commits into
main
Choose a base branch
from
stringify-ast
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
Owner
probably-neb
commented
May 11, 2024
- create stringify ast
- add notes for future ast stringify fixes
… do I know if I should do iterated instead?
… do I know if I should do iterated instead?
define i64 @main() {entry: %a3 = alloca i64 %a4 = load i64, i64* %a3 %c8 = alloca i64 %c9 = load i64, i64* %c8 %b14 = alloca i64 %b15 = load i64, i64* %b14 br label %body0body0: br label %if.cond1if.cond1: %imm_store5 = add i64 1, 0 %_6 = icmp eq i64 %a4, %imm_store5 br i1 %_6, label %then.body2, label %if.exit4then.body2: br label %then.exit3then.exit3: br label %if.exit4if.exit4: %b0 = phi i64 [ %b15, %if.cond1 ], [ %c9, %then.exit3 ] br label %exitexit: %return_reg12 = phi i64 [ %a4, %if.exit4 ] ret i64 %return_reg12}
declare i8* @malloc(i32)declare void @free(i8*)declare i32 @printf(i8*, ...)declare i32 @scanf(i8*, ...)@.println = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align [email protected] = private unnamed_addr constant [5 x i8] c"%ld \00", align [email protected] = private unnamed_addr constant [4 x i8] c"%ld\00", align [email protected]_scratch = common global i32 0, align 4define void @main() {entry: br label %body0body0: %imm_store2 = add i64 10, 0 br label %while.cond11while.cond11: %imm_store4 = add i64 0, 0 %_5 = icmp sge i64 %imm_store2, %imm_store4 br i1 %_5, label %while.body2, label %while.exit5while.body2: %a1 = phi i64 [ %imm_store2, %while.cond11 ], [ %_10, %while.fillback4 ] %_7 = getelementptr [ 5 x i8 ], [ 5 x i8 ]* @.println, i1 0, i32 0 %_8 = call i32 (i8*, ...) @printf(i8* %_7, i64 %a1) %imm_store9 = add i64 1, 0 %_10 = sub i64 %a1, %imm_store9 br label %while.cond23while.cond23: %imm_store12 = add i64 0, 0 %imm_store13 = icmp sge i64 %_10, %imm_store12 br i1 %imm_store13, label %while.fillback4, label %while.exit5while.fillback4: br label %while.body2while.exit5: %a0 = phi i64 [ %imm_store2, %while.cond11 ], [ %_10, %while.cond23 ] br label %exitexit: ret void}
…er scale fill back, I think maybe just a phi for every node? This is thinking for a later time
probably-neb
force-pushed
the
stringify-ast
branch
from
May 23, 2024 04:01
8b1d902
to
e4eb6b3
Compare
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.