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/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) {}

bool findOneNVVMAnnotation(const GlobalValue *gv, const std::string &prop,
                           unsigned &retval) {}

static std::optional<unsigned>
findOneNVVMAnnotation(const GlobalValue &GV, const std::string &PropName) {}

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

bool isTexture(const Value &val) {}

bool isSurface(const Value &val) {}

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

bool isParamGridConstant(const Value &V) {}

bool isSampler(const Value &val) {}

bool isImageReadOnly(const Value &val) {}

bool isImageWriteOnly(const Value &val) {}

bool isImageReadWrite(const Value &val) {}

bool isImage(const Value &val) {}

bool isManaged(const Value &val) {}

std::string getTextureName(const Value &val) {}

std::string getSurfaceName(const Value &val) {}

std::string getSamplerName(const Value &val) {}

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) {}

bool getMaxClusterRank(const Function &F, unsigned &x) {}

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) {}

bool getMinCTASm(const Function &F, unsigned &x) {}

bool getMaxNReg(const Function &F, unsigned &x) {}

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