LLVM 22.0.0git
NVVMIntrinsicUtils.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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 file implements functions associated with NVVM Intrinsics.
10//
11//===----------------------------------------------------------------------===//
12
14
15using namespace llvm;
16using namespace nvvm;
17
18void nvvm::printTcgen05MMAKind(raw_ostream &OS, const Constant *ImmArgVal) {
19 if (const auto *CI = dyn_cast<ConstantInt>(ImmArgVal)) {
20 uint64_t Val = CI->getZExtValue();
21 switch (static_cast<Tcgen05MMAKind>(Val)) {
23 OS << "f16";
24 return;
26 OS << "tf32";
27 return;
29 OS << "f8f6f4";
30 return;
32 OS << "i8";
33 return;
34 }
35 }
37 "printTcgen05MMAKind called with invalid value for immediate argument");
38}
39
41 const Constant *ImmArgVal) {
42 if (const auto *CI = dyn_cast<ConstantInt>(ImmArgVal)) {
43 uint64_t Val = CI->getZExtValue();
44 switch (static_cast<Tcgen05CollectorUsageOp>(Val)) {
46 OS << "discard";
47 return;
49 OS << "lastuse";
50 return;
52 OS << "fill";
53 return;
55 OS << "use";
56 return;
57 }
58 }
59 llvm_unreachable("printTcgen05CollectorUsageOp called with invalid value for "
60 "immediate argument");
61}
This file contains the definitions of the enumerations and flags associated with NVVM Intrinsics,...
This is an important base class in LLVM.
Definition Constant.h:43
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void printTcgen05MMAKind(raw_ostream &OS, const Constant *ImmArgVal)
void printTcgen05CollectorUsageOp(raw_ostream &OS, const Constant *ImmArgVal)
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643