aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp
diff options
context:
space:
mode:
authorRazvan Lupusoru <razvan.lupusoru@gmail.com>2023-12-20 07:11:19 -0800
committerGitHub <noreply@github.com>2023-12-20 07:11:19 -0800
commita711b042fded073b0764a0846aa486955e72ae49 (patch)
tree018605c536d5c39643f6d31f5fba030c8f15cd58 /llvm/lib/TextAPI/BinaryReader/DylibReader.cpp
parent476812a74260cb89c778f1f3e6ecc031ed06079c (diff)
downloadllvm-a711b042fded073b0764a0846aa486955e72ae49.zip
llvm-a711b042fded073b0764a0846aa486955e72ae49.tar.gz
llvm-a711b042fded073b0764a0846aa486955e72ae49.tar.bz2
[acc] Initial implementation of MemoryEffects on `acc` operations (#75970)
The `acc` dialect operations now implement MemoryEffects interfaces in the following ways: - Data entry operations which may read host memory via `varPtr` are now marked as so. The majority of them do NOT actually read the host memory. For example, `acc.present` works on the basis of presence of pointer and not necessarily what the data points to - so they are not marked as reading the host memory. They still use `varPtr` though but this dependency is reflected through ssa. - Data clause operations which may mutate the data pointed to by `accPtr` are marked as doing so. - Data clause operations which update required structured or dynamic runtime counters are marked as reading and writing the newly defined `RuntimeCounters` resource. Some operations, like `acc.getdeviceptr` do not actually use the runtime counters - but are marked as reading them since the address obtained depends on the mapping operations which do update the runtime counters. Namely, `acc.getdeviceptr` cannot be moved across other mapping operations. - Constructs are marked as writing to the `ConstructResource`. This may be too strict but is needed for the following reasons: 1) Structured constructs may not use `accPtr` and instead use `varPtr` - when this is the case, data actions may be removed even when used. 2) Unstructured constructs are currently used to aggregate multiple data actions. We do not want such constructs removed or moved for now. - Terminators are marked as `Pure` as in other dialects. The current approach has the following limitations which may require further improvements: - Subsequent `acc.copyin` operations on same data do not actually read host memory pointed to by `varPtr` but are still marked as so. - Two `acc.delete` operations on same data may not mutate `accPtr` until the runtime counters are zero (but are still marked as mutating). - The `varPtrPtr` argument, when present, points to the address of location of `varPtr`. When mapping to target device, an `accPtrPtr` needs computed and this memory is mutated. This effect is not captured since the current operations do not produce `accPtrPtr`. - Runtime counter effects are imprecise since two operations with differing `varPtr` increment/decrement different counters. Additionally, operations with `varPtrPtr` mutate attachment counters. - The `ConstructResource` is too strict and likely can be relaxed with better modeling.
Diffstat (limited to 'llvm/lib/TextAPI/BinaryReader/DylibReader.cpp')
0 files changed, 0 insertions, 0 deletions