Anastasia added inline comments.

================
Comment at: lib/Sema/SemaExpr.cpp:9624
 
+  if (getLangOpts().OpenCL && getLangOpts().OpenCLVersion >= 200) {
+    if (LHSIsNull && RHSType->isQueueT()) {
----------------
getLangOpts().OpenCL is redundant because getLangOpts().OpenCLVersion is only 
set for OpenCL.

I would like us to minimize number of this checks in the future.


================
Comment at: test/CodeGenOpenCL/null_queue.cl:7
+bool f() {
+  return CLK_NULL_QUEUE == get_default_queue() &&
+         get_default_queue() == CLK_NULL_QUEUE;
----------------
I think this doesn't handle initialization yet:
  queue_t q = 0;
which should also be possible! 


================
Comment at: test/CodeGenOpenCL/null_queue.cl:8
+  return CLK_NULL_QUEUE == get_default_queue() &&
+         get_default_queue() == CLK_NULL_QUEUE;
+  // CHECK: icmp eq %opencl.queue_t* null, %{{.*}}
----------------
could we just compare directly to 0 to make it simpler?


================
Comment at: test/CodeGenOpenCL/null_queue.cl:9
+         get_default_queue() == CLK_NULL_QUEUE;
+  // CHECK: icmp eq %opencl.queue_t* null, %{{.*}}
+}
----------------
Could we check for exactly two occurrences of icmp?


https://reviews.llvm.org/D27569



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

Reply via email to