arsenm added inline comments.

================
Comment at: lib/CodeGen/TargetInfo.cpp:6957-6958
+
+  llvm::Constant *translateNullPtr(const CodeGen::CodeGenModule &CGM,
+      llvm::Constant *C) const override;
 };
----------------
I was thinking that addrspacecast (generic null) should be valid for all 
targets, but I guess this saves the trouble of needing to fold out the nulls 
for the address spaces where null is supposed to be 0


================
Comment at: lib/CodeGen/TargetInfo.cpp:7038
+  auto AS = PT->getAddressSpace();
+  if (CGM.getTarget().getTriple().getArch() != llvm::Triple::amdgcn ||
+    (AS != Ctx.getTargetAddressSpace(LangAS::opencl_local) && AS != 0))
----------------
The amdgcn check should be unnecessary


================
Comment at: lib/CodeGen/TargetInfo.cpp:7039
+  if (CGM.getTarget().getTriple().getArch() != llvm::Triple::amdgcn ||
+    (AS != Ctx.getTargetAddressSpace(LangAS::opencl_local) && AS != 0))
+    return C;
----------------
Shouldn't the 0 be checking lang as::opencl_private? 


https://reviews.llvm.org/D26196



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

Reply via email to