================ @@ -0,0 +1,46 @@ +//===- CIROpenCLAttrs.td - CIR dialect attrs for OpenCL ----*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file declares the CIR dialect attributes for OpenCL. +// +//===----------------------------------------------------------------------===// + +#ifndef CLANG_CIR_DIALECT_IR_CIROPENCLATTRS_TD +#define CLANG_CIR_DIALECT_IR_CIROPENCLATTRS_TD + +//===----------------------------------------------------------------------===// +// OpenCLKernelArgMetadataAttr +//===----------------------------------------------------------------------===// + +def CIR_OpenCLKernelArgMetadataAttr + : CIR_Attr<"OpenCLKernelArgMetadata", "cl.kernel_arg_metadata"> { + let summary = "OpenCL kernel argument metadata"; + let description = [{ + Stores the OpenCL kernel argument metadata emitted to LLVM IR as + `kernel_arg_*` metadata. + + All parameters are arrays containing the argument information in source + order. The `name` field is optional and is emitted only when requested by + `-cl-kernel-arg-info`. + }]; + + let parameters = (ins + "::mlir::ArrayAttr":$addr_space, ---------------- Men-cotton wrote:
Thanks! That distinction is exactly what I am relying on here. Since `kernel_arg_addr_space` is source-level metadata, it intentionally retains the lang AS instead of being lowered to a target AS. `cir-target-lowering` only needs to handle the lang -> target conversion for pointers and globals. So #200581 keeps the lang AS in the metadata attribute, and #200582 maps this lang AS directly to the LLVM `kernel_arg_addr_space` metadata encoding when emitting LLVM IR. https://github.com/llvm/llvm-project/pull/199530 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
