Skip to content
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

phi for da D #8

Merged
merged 125 commits into from
May 25, 2024
Merged

phi for da D #8

merged 125 commits into from
May 25, 2024

Conversation

probably-neb
Copy link
Owner

  • Phi cont
  • not passing,
  • Todo overview updated, notes on how to do future work
  • Phi printing -> <-
  • haha
  • More changes
  • starting the blocks
  • cfg if implemented
  • started while
  • dom tree
  • dom fronteir almost done, seg faulting tho
  • dom fronteir almost perfect, need to clean up returns
  • I think Dominance Fronteir is working, I've no idea how to check, nor do I know if I should do iterated instead?
  • Filling BBs
  • Phi generation v3 ready to implemented
  • phi gen working

dleiferives and others added 24 commits May 22, 2024 13:54
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
The fundemental issue is that the params are not stored as regs, this will have to be fixed
@dleiferives dleiferives merged commit b0cc9e3 into main May 25, 2024
45 checks passed
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