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

Account for LLVM lifetime intrinsics in enablers #64

Open
kalxr opened this issue Jan 16, 2023 · 0 comments
Open

Account for LLVM lifetime intrinsics in enablers #64

kalxr opened this issue Jan 16, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@kalxr
Copy link
Contributor

kalxr commented Jan 16, 2023

Currently NOELLE enablers do not necessarily respect the semantics of LLVM's lifetime intrinsics. Consider the following pseudocode:

for i in ...
  call llvm.lifetime.start(obj)
  obj[i] = x
  call llvm.lifetime.end(obj)
  ...

If you perform a loop distribution on this loop, you may end up with something like the following (inspired by a real example):

for i in ...
  obj[i] = x
for i in ...
  call llvm.lifetime.end(obj)
for i in ...
  call llvm.lifetime.start(obj)

While this won't always lead to perceivable errors, it is incorrect. The current solution is to remove the lifetime markers from modified code after parallelization. However, intermediate bitcode at earlier points in the pipeline can still be wrong. Removing correct lifetime markers can also negatively impact performance. The ideal solution would account for lifetime intrinsics without naively removing any from modified code.

Part of the reason we break these semantics is that these intrinsics are ignored by the PDG analysis, so transformations are not constrained in modifying them as they would be with normal call instructions.

@scampanoni scampanoni added the enhancement New feature or request label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants