arsenm added inline comments.

================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9238
 
+static llvm::Function *getKernelClone(llvm::Function &F) {
+  llvm::Module *M = F.getParent();
----------------
I don't think we can really start with the function IR. The TargetABIInfo could 
be different from the kernel and function form (and will due to using 
byval/byref etc.)


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9240
+  llvm::Module *M = F.getParent();
+  SmallString<128> MangledName("__amdgpu_");
+  MangledName.append(F.getName());
----------------
I don't think adding a prefix and suffix is a good strategy for something which 
in principle should be ABI visible. A period + suffix I think would be a better 
convention


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9478-9479
+
+      CI->setCalledFunction(Clone);
+      CI->setCallingConv(llvm::CallingConv::C);
+    }
----------------
This is basically just moving what the current hack does into clang. Can we 
emit calls to the function version up front?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120566/new/

https://reviews.llvm.org/D120566

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to