[PATCH] D17596: [OpenCL] Add ocl and spir version for spir target

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 26 02:40:57 PST 2016


Anastasia added inline comments.

================
Comment at: lib/CodeGen/TargetInfo.cpp:7211
@@ +7210,3 @@
+
+/// SPIR uses emitTargetMD to emit spir spec requried metadate.
+void SPIRTargetCodeGenInfo::emitTargetMD(const Decl *D, llvm::GlobalValue *GV,
----------------
Could you change the comment please to something more specific. For example:
"Emit SPIR specific metadata: OpenCL and SPIR version."

================
Comment at: lib/CodeGen/TargetInfo.cpp:7214
@@ +7213,3 @@
+                                         CodeGen::CodeGenModule &CGM) const {
+  assert(CGM.getLangOpts().OpenCL && "SPIR is only for OpenCL\n");
+  llvm::LLVMContext &Ctx = CGM.getModule().getContext();
----------------
Remove \n

================
Comment at: test/CodeGenOpenCL/spir_version.cl:15
@@ +14,2 @@
+// CL20: !opencl.ocl.version = !{[[SPIR:![0-9]+]]}
+// CL20: [[SPIR]] = !{i32 2, i32 0}
----------------
Forgotten to check OpenCL version here?


http://reviews.llvm.org/D17596





More information about the cfe-commits mailing list