[PATCH] D98608: [Attributor] Make sure Heap2Stack works properly on a GPU target
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 22 11:25:06 PDT 2021
jdoerfert marked an inline comment as done.
jdoerfert added inline comments.
================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:961
+ /// Return true if the stack (llvm::Alloca) can be accessed by other threads.
+ bool stackIsAccessibleByOtherThreads() {
+ return !targetIsGPU();
----------------
madhur13490 wrote:
> 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.
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.
================
Comment at: llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll:7
-declare noalias i8* @malloc(i64)
+target triple = "nvptx64"
+
----------------
madhur13490 wrote:
> May be have a test "amdgpu" triple too?
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.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98608/new/
https://reviews.llvm.org/D98608
More information about the llvm-commits
mailing list