Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

[Flang][OpenMP][MLIR] Create lifetime markers for allocations only used within OpenMP loop regions #232

Merged

Conversation

skatrak
Copy link
Contributor

@skatrak skatrak commented Sep 27, 2023

By creating llvm.lifetime.start and llvm.lifetime.end markers for outside allocations around the body of the loop produced for omp.wsloop and omp.simdloop MLIR operations, later uses of the LLVM CodeExtractor class to potentially outline the body of these loops into independent functions will be able to see the reduced scope of use of these allocations and sink them into the outlined function's body rather than to unnecessarily pass them as arguments. This can also help later optimization stages to detect cases where allocations for loop indices are redundant.

Currently it doesn't provide any benefits if applied on its own, but it improves the code generated for target worksharing loop in PR #231.

@skatrak skatrak self-assigned this Sep 27, 2023
…ed within OpenMP loop regions

By creating `llvm.lifetime.start` and `llvm.lifetime.end` markers for outside
allocations around the body of the loop produced for `omp.wsloop` and
`omp.simdloop` MLIR operations, later uses of the LLVM `CodeExtractor` class to
potentially outline the body of these loops into independent functions will be
able to see the reduced scope of use of these allocations and sink them into
the outlined function's body rather than to unnecessarily pass them as
arguments. This can also help later optimization stages to detect cases where
allocations for loop indices are redundant.
@gregrodgers gregrodgers merged commit 26c4106 into ROCm-Developer-Tools:amd-trunk-dev Sep 29, 2023
2 checks passed
@skatrak skatrak deleted the lifetime_alloca_loop branch September 29, 2023 14:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants