If the target stack is not accessible between different running
"threads" we have to make sure not to create allocas for mallocs
that might be used by multiple "threads". The "use check" is
sufficient to prevent this but if we apply the "free check" we have
to make sure the pointer is not communicated to others before
the free is reached.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Transforms/IPO/Attributor.h | ||
---|---|---|
961 | I don't think it is limited to just GPUs. Generally, it is applicable to machines where stack is not shared by multiple threads e.g. this is applicable to X86 threading model too if I am not mistaken - stack is indeed private. | |
llvm/lib/Transforms/IPO/AttributorAttributes.cpp | ||
5120 | Typo in "sharable"; "needs to be places" ->placed. | |
llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll | ||
7 | May be have a test "amdgpu" triple too? |
llvm/include/llvm/Transforms/IPO/Attributor.h | ||
---|---|---|
961 | This might not be only for GPUs but I don't know what else to add. X86 stack is not thread private in the sense that other threads could not access it. | |
llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll | ||
7 | I was already insistent to copy the file once, do we really need to copy it again? I can just make this amdgpu for all I care. |
clang-format: please reformat the code