clang 23.0.0git
CIRGenAMDGPU.cpp
Go to the documentation of this file.
1//===- CIRGenAMDGPU.cpp - AMDGPU-specific logic for CIR generation --------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This contains code dealing with AMDGPU-specific logic of CIR generation.
10//
11//===----------------------------------------------------------------------===//
12
13#include "CIRGenModule.h"
14
17#include "llvm/TargetParser/Triple.h"
18
19using namespace clang;
20using namespace clang::CIRGen;
21
23 // Emit code object version module flag.
24 if (target.getTargetOpts().CodeObjectVersion !=
25 llvm::CodeObjectVersionKind::COV_None) {
26 theModule->setAttr(
27 cir::CIRDialect::getAMDGPUCodeObjectVersionAttrName(),
28 builder.getI32IntegerAttr(target.getTargetOpts().CodeObjectVersion));
29 }
30
31 // Emit printf kind module flag for HIP.
32 if (langOpts.HIP) {
33 llvm::StringRef printfKind =
34 target.getTargetOpts().AMDGPUPrintfKindVal ==
36 ? "hostcall"
37 : "buffered";
38 theModule->setAttr(cir::CIRDialect::getAMDGPUPrintfKindAttrName(),
39 builder.getStringAttr(printfKind));
40 }
41}
Defines the clang::TargetOptions class.
void emitAMDGPUMetadata()
Emits AMDGPU specific Metadata.
@ Hostcall
printf lowering scheme involving hostcalls, currently used by HIP programs by default
The JSON file list parser is used to communicate input to InstallAPI.