llvm/llvm/lib/Target/NVPTX/NVPTXUtilities.cpp

//===- NVPTXUtilities.cpp - Utility Functions -----------------------------===//
//
// 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 contains miscellaneous utility functions
//
//===----------------------------------------------------------------------===//

#include "NVPTXUtilities.h"
#include "NVPTX.h"
#include "NVPTXTargetMachine.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Mutex.h"
#include <algorithm>
#include <cstring>
#include <map>
#include <mutex>
#include <optional>
#include <string>
#include <vector>

namespace llvm {

namespace {
key_val_pair_t;
global_val_annot_t;

struct AnnotationCache {};

AnnotationCache &getAnnotationCache() {}
} // anonymous namespace

void clearAnnotationCache(const Module *Mod) {}

static void readIntVecFromMDNode(const MDNode *MetadataNode,
                                 std::vector<unsigned> &Vec) {}

static void cacheAnnotationFromMD(const MDNode *MetadataNode,
                                  key_val_pair_t &retval) {}

static void cacheAnnotationFromMD(const Module *m, const GlobalValue *gv) {}

static std::optional<unsigned> findOneNVVMAnnotation(const GlobalValue *gv,
                                                     const std::string &prop) {}

static bool findAllNVVMAnnotation(const GlobalValue *gv,
                                  const std::string &prop,
                                  std::vector<unsigned> &retval) {}

static bool globalHasNVVMAnnotation(const Value &V, const std::string &Prop) {}

static bool argHasNVVMAnnotation(const Value &Val,
                                 const std::string &Annotation,
                                 const bool StartArgIndexAtOne = false) {}

bool isParamGridConstant(const Value &V) {}

bool isTexture(const Value &V) {}

bool isSurface(const Value &V) {}

bool isSampler(const Value &V) {}

bool isImageReadOnly(const Value &V) {}

bool isImageWriteOnly(const Value &V) {}

bool isImageReadWrite(const Value &V) {}

bool isImage(const Value &V) {}

bool isManaged(const Value &V) {}

StringRef getTextureName(const Value &V) {}

StringRef getSurfaceName(const Value &V) {}

StringRef getSamplerName(const Value &V) {}

std::optional<unsigned> getMaxNTIDx(const Function &F) {}

std::optional<unsigned> getMaxNTIDy(const Function &F) {}

std::optional<unsigned> getMaxNTIDz(const Function &F) {}

std::optional<unsigned> getMaxNTID(const Function &F) {}

std::optional<unsigned> getClusterDimx(const Function &F) {}

std::optional<unsigned> getClusterDimy(const Function &F) {}

std::optional<unsigned> getClusterDimz(const Function &F) {}

std::optional<unsigned> getMaxClusterRank(const Function &F) {}

std::optional<unsigned> getReqNTIDx(const Function &F) {}

std::optional<unsigned> getReqNTIDy(const Function &F) {}

std::optional<unsigned> getReqNTIDz(const Function &F) {}

std::optional<unsigned> getReqNTID(const Function &F) {}

std::optional<unsigned> getMinCTASm(const Function &F) {}

std::optional<unsigned> getMaxNReg(const Function &F) {}

bool isKernelFunction(const Function &F) {}

MaybeAlign getAlign(const Function &F, unsigned Index) {}

MaybeAlign getAlign(const CallInst &I, unsigned Index) {}

Function *getMaybeBitcastedCallee(const CallBase *CB) {}

bool shouldEmitPTXNoReturn(const Value *V, const TargetMachine &TM) {}

bool Isv2x16VT(EVT VT) {}

} // namespace llvm