[PATCH] D62413: [OpenCL][PR41727] Prevent ICE on global dtors

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 3 06:55:22 PDT 2019


Anastasia marked an inline comment as done.
Anastasia added inline comments.


================
Comment at: lib/CodeGen/CGDeclCXX.cpp:132
+      Argument = CGM.getTargetCodeGenInfo().performAddrSpaceCast(
+          CGM, Addr.getPointer(), SrcAS, LangAS::opencl_global, DestTy);
 
----------------
rjmccall wrote:
> Should this code be conditional to OpenCL?  And why does `_cxa_atexit` take a `__global` pointer instead of, say, a `__generic` one?
The only objects that are destructible globally in OpenCL are `__global` and `__constant`. However `__constant` isn't convertible to `__generic`. Therefore, I am adding `__global` directly to avoid extra conversion. I am not yet sure how to handle `__constant`though and how much destructing objects in read-only memory segments would make sense anyway. I think I will address this separately.


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

https://reviews.llvm.org/D62413





More information about the cfe-commits mailing list