LLVM 20.0.0git
Macros | Functions | Variables
NVPTXAsmPrinter.cpp File Reference
#include "NVPTXAsmPrinter.h"
#include "MCTargetDesc/NVPTXBaseInfo.h"
#include "MCTargetDesc/NVPTXInstPrinter.h"
#include "MCTargetDesc/NVPTXMCAsmInfo.h"
#include "MCTargetDesc/NVPTXTargetStreamer.h"
#include "NVPTX.h"
#include "NVPTXMCExpr.h"
#include "NVPTXMachineFunctionInfo.h"
#include "NVPTXRegisterInfo.h"
#include "NVPTXSubtarget.h"
#include "NVPTXTargetMachine.h"
#include "NVPTXUtilities.h"
#include "TargetInfo/NVPTXTargetInfo.h"
#include "cl_common_defines.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGenTypes/MachineValueType.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/User.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/NativeFormatting.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/TargetParser/Triple.h"
#include "llvm/Transforms/Utils/UnrollLoop.h"
#include <cassert>
#include <cstdint>
#include <cstring>
#include <new>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Macros

#define DEPOTNAME   "__local_depot"
 

Functions

static void DiscoverDependentGlobals (const Value *V, DenseSet< const GlobalVariable * > &Globals)
 DiscoverDependentGlobals - Return a set of GlobalVariables on which V depends.
 
static void VisitGlobalVariableForEmission (const GlobalVariable *GV, SmallVectorImpl< const GlobalVariable * > &Order, DenseSet< const GlobalVariable * > &Visited, DenseSet< const GlobalVariable * > &Visiting)
 VisitGlobalVariableForEmission - Add GV to the list of GlobalVariable instances to be emitted, but only after any dependents have been added first.s.
 
static bool ShouldPassAsArray (Type *Ty)
 
static bool usedInGlobalVarDef (const Constant *C)
 
static bool usedInOneFunc (const User *U, Function const *&oneFunc)
 
static bool canDemoteGlobalVar (const GlobalVariable *gv, Function const *&f)
 
static bool useFuncSeen (const Constant *C, DenseMap< const Function *, bool > &seenMap)
 
static bool isEmptyXXStructor (GlobalVariable *GV)
 
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXAsmPrinter ()
 

Variables

static cl::opt< boolLowerCtorDtor ("nvptx-lower-global-ctor-dtor", cl::desc("Lower GPU ctor / dtors to globals on the device."), cl::init(false), cl::Hidden)
 

Macro Definition Documentation

◆ DEPOTNAME

#define DEPOTNAME   "__local_depot"

Definition at line 102 of file NVPTXAsmPrinter.cpp.

Function Documentation

◆ canDemoteGlobalVar()

static bool canDemoteGlobalVar ( const GlobalVariable gv,
Function const *&  f 
)
static

◆ DiscoverDependentGlobals()

static void DiscoverDependentGlobals ( const Value V,
DenseSet< const GlobalVariable * > &  Globals 
)
static

DiscoverDependentGlobals - Return a set of GlobalVariables on which V depends.

Definition at line 107 of file NVPTXAsmPrinter.cpp.

References DiscoverDependentGlobals(), and llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert().

Referenced by DiscoverDependentGlobals(), and VisitGlobalVariableForEmission().

◆ isEmptyXXStructor()

static bool isEmptyXXStructor ( GlobalVariable GV)
static

◆ LLVMInitializeNVPTXAsmPrinter()

LLVM_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXAsmPrinter ( )

Definition at line 2266 of file NVPTXAsmPrinter.cpp.

References llvm::getTheNVPTXTarget32(), llvm::getTheNVPTXTarget64(), X, and Y.

◆ ShouldPassAsArray()

static bool ShouldPassAsArray ( Type Ty)
static

◆ usedInGlobalVarDef()

static bool usedInGlobalVarDef ( const Constant C)
static

Definition at line 643 of file NVPTXAsmPrinter.cpp.

References llvm::CallingConv::C, and usedInGlobalVarDef().

Referenced by usedInGlobalVarDef().

◆ usedInOneFunc()

static bool usedInOneFunc ( const User U,
Function const *&  oneFunc 
)
static

Definition at line 659 of file NVPTXAsmPrinter.cpp.

References instr, and usedInOneFunc().

Referenced by canDemoteGlobalVar(), and usedInOneFunc().

◆ useFuncSeen()

static bool useFuncSeen ( const Constant C,
DenseMap< const Function *, bool > &  seenMap 
)
static

◆ VisitGlobalVariableForEmission()

static void VisitGlobalVariableForEmission ( const GlobalVariable GV,
SmallVectorImpl< const GlobalVariable * > &  Order,
DenseSet< const GlobalVariable * > &  Visited,
DenseSet< const GlobalVariable * > &  Visiting 
)
static

Variable Documentation

◆ LowerCtorDtor

cl::opt< bool > LowerCtorDtor("nvptx-lower-global-ctor-dtor", cl::desc("Lower GPU ctor / dtors to globals on the device."), cl::init(false), cl::Hidden) ( "nvptx-lower-global-ctor-dtor"  ,
cl::desc("Lower GPU ctor / dtors to globals on the device.")  ,
cl::init(false)  ,
cl::Hidden   
)
static