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

Local blocks alignment #832

Open
nunoplopes opened this issue Aug 14, 2022 · 0 comments
Open

Local blocks alignment #832

nunoplopes opened this issue Aug 14, 2022 · 0 comments
Labels
memory Memory Model

Comments

@nunoplopes
Copy link
Member

This example shows that we need to align src/tgt's local blocks. Described in the paper but not implemented yet:

define ptr @src(i8 %arg) {
bb:
  %tmp = icmp ne i8 %arg, 0
  br i1 %tmp, label %bb1, label %bb3

bb1:
  %tmp2 = call noalias ptr @f()
  br label %bb5

bb3:
  %tmp4 = call noalias ptr @f()
  br label %bb5

bb5:
  %tmp6 = phi ptr [ null, %bb1 ], [ %tmp4, %bb3 ]
  %tmp7 = call ptr @h(ptr %tmp6)
  ret ptr %tmp7
}

define ptr @tgt(i8 %arg) {
bb:
  %tmp = icmp eq i8 %arg, 0
  br i1 %tmp, label %bb3, label %bb1

bb1:
  %tmp2 = call noalias ptr @f()
  br label %bb5

bb3:
  %tmp4 = call noalias ptr @f()
  br label %bb5

bb5:
  %tmp6 = phi ptr [ null, %bb1 ], [ %tmp4, %bb3 ]
  %tmp7 = call ptr @h(ptr %tmp6)
  ret ptr %tmp7
}

declare ptr @f()
declare ptr @h(ptr)
@nunoplopes nunoplopes added the memory Memory Model label Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory Memory Model
Projects
None yet
Development

No branches or pull requests

1 participant