[PATCH] D141008: [Clang][SPIR-V] Emit target extension types for OpenCL types on SPIR-V.

Ilia Diachkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 27 11:59:51 PST 2023


iliya-diyachkov added inline comments.


================
Comment at: clang/lib/CodeGen/CGOpenCLRuntime.cpp:100-112
+llvm::Type *CGOpenCLRuntime::getSamplerType(const Type *T) {
+  if (!SamplerTy) {
+    if (llvm::Type *TransTy = CGM.getTargetCodeGenInfo().getOpenCLType(
+            CGM, CGM.getContext().OCLSamplerTy.getTypePtr()))
+      SamplerTy = TransTy;
+    else
+      SamplerTy = llvm::PointerType::get(
----------------
Perhaps use early exits like this, or even removing 'else' clause.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141008



More information about the cfe-commits mailing list