[clang] [llvm] Enable OpenCL hostcall printf (WIP) (PR #72556)

Vikram Hegde via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 24 10:21:25 PST 2023


================
@@ -170,20 +173,49 @@ static Value *appendString(IRBuilder<> &Builder, Value *Desc, Value *Arg,
   return callAppendStringN(Builder, Desc, Arg, Length, IsLast);
 }
 
+static Value *appendVectorArg(IRBuilder<> &Builder, Value *Desc, Value *Arg,
+                              bool IsLast, bool IsBuffered) {
+  assert(Arg->getType()->isVectorTy() && "incorrent append* function");
+  auto VectorTy = dyn_cast<FixedVectorType>(Arg->getType());
+  auto Zero = Builder.getInt64(0);
+  if (VectorTy) {
----------------
vikramRH wrote:

I have changed this code a little now so that only FixedVectorTypes are handled. This should be okay since the OCL specs specifically say only vectors of length 2,3,4,8 and 16 are supported for printf.

https://github.com/llvm/llvm-project/pull/72556


More information about the cfe-commits mailing list