|
LLVM 24.0.0git
|
#include "NVPTXAsmPrinter.h"#include "MCTargetDesc/NVPTXBaseInfo.h"#include "MCTargetDesc/NVPTXInstPrinter.h"#include "MCTargetDesc/NVPTXTargetStreamer.h"#include "NVPTX.h"#include "NVPTXDwarfDebug.h"#include "NVPTXMCExpr.h"#include "NVPTXMachineFunctionInfo.h"#include "NVPTXRegisterInfo.h"#include "NVPTXSubtarget.h"#include "NVPTXTargetMachine.h"#include "NVPTXUtilities.h"#include "NVVMProperties.h"#include "TargetInfo/NVPTXTargetInfo.h"#include "cl_common_defines.h"#include "llvm/ADT/APFloat.h"#include "llvm/ADT/APInt.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/DenseSet.h"#include "llvm/ADT/SCCIterator.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/Sequence.h"#include "llvm/ADT/SmallPtrSet.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/ADT/iterator_range.h"#include "llvm/Analysis/ConstantFolding.h"#include "llvm/CodeGen/Analysis.h"#include "llvm/CodeGen/AsmPrinter.h"#include "llvm/CodeGen/AsmPrinterAnalysis.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstr.h"#include "llvm/CodeGen/MachineJumpTableInfo.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/Argument.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/InstrTypes.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/IR/Value.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/Pass.h"#include "llvm/Support/Alignment.h"#include "llvm/Support/Casting.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Endian.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/NativeFormatting.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetLoweringObjectFile.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Transforms/Utils/UnrollLoop.h"#include <algorithm>#include <cassert>#include <cstdint>#include <cstring>#include <map>#include <memory>#include <set>#include <string>#include <type_traits>#include <vector>Go to the source code of this file.
Macros | |
| #define | DEPOTNAME "__local_depot" |
Functions | |
| static void | emitInitialRawDwarfLocDirective (const MachineFunction &MF, DwarfDebug *DD, MCStreamer &OutStreamer) |
| Emits initial debug location directive. | |
| static NVPTX::VirtualRegisterKind | getVirtualRegisterKind (const TargetRegisterClass *RC) |
| template<typename OwnerT> | |
| static void | printParam (const OwnerT *Owner, Type *Ty, unsigned AttrIdx, bool IsByVal, bool IsKernel, StringRef Name, const DataLayout &DL, raw_ostream &O) |
| template<typename OwnerT> | |
| static void | printReturnValClause (const OwnerT *Owner, StringRef Name, const DataLayout &DL, raw_ostream &O) |
| 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, const SmallPtrSetImpl< const Function * > &SeenSet) |
| static bool | hasFullDebugInfo (Module &M) |
| static StringRef | getPTXAddressSpaceName (unsigned AddressSpace) |
The PTX state space directive for AddressSpace, or an empty string if it does not name one, as is the case for the generic address space. | |
| static StringRef | getPTXOpaqueTypeName (PTXOpaqueType OpaqueType) |
| The PTX opaque type directive for an image or sampler handle, or an empty string for PTXOpaqueType::None. | |
| static bool | isPTXInstruction (StringRef Line) |
Returns true if Line begins with an alphabetic character or underscore, indicating it is a PTX instruction that should receive a .loc directive. | |
| static const DILocation * | getInlineAsmDebugLoc (const MachineInstr *MI) |
| Returns the DILocation for an inline asm MachineInstr if debug line info should be emitted, or nullptr otherwise. | |
| static InlineAsmInliningContext | getInlineAsmInliningContext (const DILocation *DL, const MachineFunction &MF, NVPTXDwarfDebug *NVDD, MCStreamer &Streamer, unsigned CUID) |
| Resolves the enhanced-lineinfo inlining context for an inline asm debug location. | |
| INITIALIZE_PASS (NVPTXAsmPrinter, "nvptx-asm-printer", "NVPTX Assembly Printer", false, false) extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXAsmPrinter() | |
| #define DEPOTNAME "__local_depot" |
Definition at line 112 of file NVPTXAsmPrinter.cpp.
|
static |
Definition at line 1063 of file NVPTXAsmPrinter.cpp.
References llvm::NVPTXAS::ADDRESS_SPACE_SHARED, llvm::GlobalValue::getAddressSpace(), llvm::GlobalValue::hasLocalLinkage(), and usedInOneFunc().
|
static |
Emits initial debug location directive.
Definition at line 377 of file NVPTXAsmPrinter.cpp.
References assert(), llvm::DwarfDebug::emitInitialLocDirective(), llvm::MachineFunction::getFunction(), llvm::Function::getSubprogram(), and llvm::MCStreamer::hasRawTextSupport().
|
static |
Returns the DILocation for an inline asm MachineInstr if debug line info should be emitted, or nullptr otherwise.
Definition at line 2427 of file NVPTXAsmPrinter.cpp.
References DL, MI, and llvm::DICompileUnit::NoDebug.
|
static |
Resolves the enhanced-lineinfo inlining context for an inline asm debug location.
Returns a default (empty) context if inlining info is unavailable.
Definition at line 2453 of file NVPTXAsmPrinter.cpp.
References DL, llvm::getDISubprogram(), llvm::NVPTXDwarfDebug::getOrCreateFuncNameSymbol(), llvm::NVPTXDwarfDebug::isEnhancedLineinfo(), and Streamer.
The PTX state space directive for AddressSpace, or an empty string if it does not name one, as is the case for the generic address space.
Definition at line 1691 of file NVPTXAsmPrinter.cpp.
References llvm::NVPTXAS::ADDRESS_SPACE_CONST, llvm::NVPTXAS::ADDRESS_SPACE_GLOBAL, llvm::NVPTXAS::ADDRESS_SPACE_LOCAL, and llvm::NVPTXAS::ADDRESS_SPACE_SHARED.
|
static |
The PTX opaque type directive for an image or sampler handle, or an empty string for PTXOpaqueType::None.
Definition at line 1708 of file NVPTXAsmPrinter.cpp.
References llvm_unreachable, llvm::None, llvm::Sampler, llvm::Surface, and llvm::Texture.
|
static |
Definition at line 629 of file NVPTXAsmPrinter.cpp.
References llvm::NVPTX::B1, llvm::NVPTX::B128, llvm::NVPTX::B16, llvm::NVPTX::B32, llvm::NVPTX::B64, and llvm_unreachable.
Definition at line 1263 of file NVPTXAsmPrinter.cpp.
References llvm::DICompileUnit::DebugDirectivesOnly, llvm::DICompileUnit::FullDebug, llvm::DICompileUnit::LineTablesOnly, and llvm::DICompileUnit::NoDebug.
| INITIALIZE_PASS | ( | NVPTXAsmPrinter | , |
| "nvptx-asm-printer" | , | ||
| "NVPTX Assembly Printer" | , | ||
| false | , | ||
| false | ) |
Definition at line 2531 of file NVPTXAsmPrinter.cpp.
References llvm::getTheNVPTXTarget32(), llvm::getTheNVPTXTarget64(), LLVM_ABI, LLVM_EXTERNAL_VISIBILITY, X, and Y.
Returns true if Line begins with an alphabetic character or underscore, indicating it is a PTX instruction that should receive a .loc directive.
Definition at line 2418 of file NVPTXAsmPrinter.cpp.
References llvm::StringRef::empty(), and llvm::StringRef::ltrim().
|
static |
Definition at line 678 of file NVPTXAsmPrinter.cpp.
References assert(), DL, llvm::getDeviceByValParamAlign(), llvm::getPTXParamAlign(), Owner, llvm::promoteScalarArgumentSize(), llvm::promoteScalarKernelArgumentSize(), llvm::shouldPassAsArray(), Size, and llvm::Align::value().
Referenced by printReturnValClause().
|
static |
Definition at line 702 of file NVPTXAsmPrinter.cpp.
References DL, llvm::Type::isEmptyTy(), llvm::Type::isVoidTy(), Owner, and printParam().
Definition at line 1019 of file NVPTXAsmPrinter.cpp.
References C(), llvm::dyn_cast(), llvm::Value::getName(), and usedInGlobalVarDef().
Referenced by usedInGlobalVarDef().
Definition at line 1034 of file NVPTXAsmPrinter.cpp.
References llvm::dyn_cast(), I, usedInOneFunc(), and llvm::Value::users().
Referenced by canDemoteGlobalVar(), and usedInOneFunc().
Definition at line 1080 of file NVPTXAsmPrinter.cpp.
References C(), llvm::SmallPtrSetImpl< PtrType >::contains(), llvm::dyn_cast(), I, and useFuncSeen().
Referenced by useFuncSeen().