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

Register allocation tests #47

Open
brandonLi8 opened this issue Mar 13, 2023 · 0 comments
Open

Register allocation tests #47

brandonLi8 opened this issue Mar 13, 2023 · 0 comments

Comments

@brandonLi8
Copy link
Owner

A lot of the register allocation tests have IRs that are outdated.

Additionally add the following register allocation test for if statements

let a: int = let b: int = a

##
let a: int = 0
let b: int = 0
let c: int = 0

let d: int = if (if true { c <= 0 } else { 1 + 2 + 3 < 6 }) {
  a + b
}
else if (if false { false } else { true }) {
  2
}
else {
  let d: int = b + c + 2
}



let a = 0
let b = 0
let c = 0

let temp2 = if true {                {a, b, c}
  c <= 0                             {temp2, a, b, c}
}
else {
  let temp0 = 1 + 2                  {temp2, a, b, c}
  let temp1 = temp0 + temp3          {temp0, temp2, a, b, c}
  temp1 < 6                          {temp1, temp2, a, b, c}
}

let d = if temp2 {                                             {temp2, a, b, c}
  a + b                              {d, a, b}
}
else {
  let temp3 = if false {             {d, b, c}
    false
  }
  else {
    true
  }

  if temp3 {                         {d, b, c, temp3}
    2                                {d}
  } else {
    let temp4 = b + c                {d, b, c}
    let e = temp4 + 2                {d, temp4}
    e                                {e, d}
  }
}

d                                                               {d}
##
``` (from #44 )
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

No branches or pull requests

1 participant