54 #define DEPOTNAME "__local_depot"
58 cl::desc(
"NVPTX Specific: Emit Line numbers even without -G"),
63 cl::desc(
"NVPTX Specific: Emit source line in ptx file"),
69 void DiscoverDependentGlobals(
const Value *V,
74 if (
const User *U = dyn_cast<User>(V)) {
75 for (
unsigned i = 0, e = U->getNumOperands(); i != e; ++i) {
76 DiscoverDependentGlobals(U->getOperand(i), Globals);
85 void VisitGlobalVariableForEmission(
90 if (Visited.
count(GV))
94 if (!Visiting.
insert(GV).second)
100 DiscoverDependentGlobals(GV->
getOperand(i), Others);
105 VisitGlobalVariableForEmission(*
I, Order, Visited, Visiting);
133 auto *Scope = cast_or_null<DIScope>(curLoc.
getScope());
137 StringRef fileName(Scope->getFilename());
138 StringRef dirName(Scope->getDirectory());
142 fileName = FullPathName;
145 if (filenameMap.find(fileName) == filenameMap.end())
150 this->emitSrcInText(fileName, curLoc.
getLine());
152 std::stringstream temp;
153 temp <<
"\t.loc " << filenameMap[fileName] <<
" " << curLoc.
getLine()
154 <<
" " << curLoc.
getCol();
161 if (static_cast<NVPTXTargetMachine &>(
TM).getDrvInterface() ==
NVPTX::CUDA)
165 lowerToMCInst(MI, Inst);
170 bool NVPTXAsmPrinter::lowerImageHandleOperand(
const MachineInstr *MI,
178 if (OpNo == 4 && MO.
isImm()) {
179 lowerImageHandleSymbol(MO.
getImm(), MCOp);
183 lowerImageHandleSymbol(MO.
getImm(), MCOp);
193 if (OpNo == VecSize && MO.
isImm()) {
194 lowerImageHandleSymbol(MO.
getImm(), MCOp);
201 if (OpNo == 0 && MO.
isImm()) {
202 lowerImageHandleSymbol(MO.
getImm(), MCOp);
209 if (OpNo == 1 && MO.
isImm()) {
210 lowerImageHandleSymbol(MO.
getImm(), MCOp);
220 void NVPTXAsmPrinter::lowerImageHandleSymbol(
unsigned Index,
MCOperand &MCOp) {
226 std::string *SymNamePtr =
235 if (MI->
getOpcode() == NVPTX::CALL_PROTOTYPE) {
247 if (lowerImageHandleOperand(MI, i, MCOp)) {
253 if (lowerOperand(MO, MCOp))
299 unsigned NVPTXAsmPrinter::encodeVirtualRegister(
unsigned Reg) {
304 unsigned RegNum = RegMap[
Reg];
309 if (RC == &NVPTX::Int1RegsRegClass) {
311 }
else if (RC == &NVPTX::Int16RegsRegClass) {
313 }
else if (RC == &NVPTX::Int32RegsRegClass) {
315 }
else if (RC == &NVPTX::Int64RegsRegClass) {
317 }
else if (RC == &NVPTX::Float32RegsRegClass) {
319 }
else if (RC == &NVPTX::Float64RegsRegClass) {
326 Ret |= (RegNum & 0x0FFFFFFF);
331 return Reg & 0x0FFFFFFF;
358 if (
const IntegerType *ITy = dyn_cast<IntegerType>(Ty)) {
359 size = ITy->getBitWidth();
367 O <<
".param .b" << size <<
" func_retval0";
368 }
else if (isa<PointerType>(Ty)) {
373 unsigned retAlignment = 0;
376 O <<
".param .align " << retAlignment <<
" .b8 func_retval0[" << totalsz
384 for (
unsigned i = 0, e = vtparts.
size(); i != e; ++i) {
386 EVT elemtype = vtparts[i];
387 if (vtparts[i].isVector()) {
388 elems = vtparts[i].getVectorNumElements();
389 elemtype = vtparts[i].getVectorElementType();
392 for (
unsigned j = 0, je = elems; j != je; ++j) {
396 O <<
".reg .b" << sz <<
" func_retval" << idx;
412 printReturnValStr(F, O);
418 bool NVPTXAsmPrinter::isLoopHeaderOfNoUnroll(
435 if (
MDNode *LoopID = PBB->getTerminator()->getMetadata(
"llvm.loop")) {
446 if (isLoopHeaderOfNoUnroll(MBB))
450 void NVPTXAsmPrinter::EmitFunctionEntryLabel() {
454 if (!GlobalsEmitted) {
456 GlobalsEmitted =
true;
462 emitLinkageDirective(F, O);
467 printReturnValStr(*MF, O);
472 emitFunctionParamList(*MF, O);
475 emitKernelFunctionDirectives(*F, O);
482 void NVPTXAsmPrinter::EmitFunctionBodyStart() {
485 setAndEmitFunctionVirtualRegisters(*MF);
493 void NVPTXAsmPrinter::EmitFunctionBodyEnd() {
498 void NVPTXAsmPrinter::emitImplicitDef(
const MachineInstr *MI)
const {
510 void NVPTXAsmPrinter::emitKernelFunctionDirectives(
const Function &F,
515 unsigned reqntidx, reqntidy, reqntidz;
516 bool specified =
false;
531 O <<
".reqntid " << reqntidx <<
", " << reqntidy <<
", " << reqntidz
537 unsigned maxntidx, maxntidy, maxntidz;
553 O <<
".maxntid " << maxntidx <<
", " << maxntidy <<
", " << maxntidz
558 O <<
".minnctapersm " << mincta <<
"\n";
569 assert(I != VRegMapping.
end() &&
"Bad register class");
573 assert(VI != RegMap.end() &&
"Bad virtual register");
574 unsigned MappedVR = VI->second;
582 void NVPTXAsmPrinter::emitVirtualRegister(
unsigned int vr,
587 void NVPTXAsmPrinter::printVecModifiedImmediate(
589 static const char vecelem[] = {
'0',
'1',
'2',
'3',
'0',
'1',
'2',
'3' };
591 if (0 == strcmp(Modifier,
"vecelem"))
592 O <<
"_" << vecelem[Imm];
593 else if (0 == strcmp(Modifier,
"vecv4comm1")) {
594 if ((Imm < 0) || (Imm > 3))
596 }
else if (0 == strcmp(Modifier,
"vecv4comm2")) {
597 if ((Imm < 4) || (Imm > 7))
599 }
else if (0 == strcmp(Modifier,
"vecv4pos")) {
602 O <<
"_" << vecelem[Imm % 4];
603 }
else if (0 == strcmp(Modifier,
"vecv2comm1")) {
604 if ((Imm < 0) || (Imm > 1))
606 }
else if (0 == strcmp(Modifier,
"vecv2comm2")) {
607 if ((Imm < 2) || (Imm > 3))
609 }
else if (0 == strcmp(Modifier,
"vecv2pos")) {
612 O <<
"_" << vecelem[Imm % 2];
621 emitLinkageDirective(F, O);
626 printReturnValStr(F, O);
629 emitFunctionParamList(F, O);
638 if (GV->
getName() ==
"llvm.used")
644 if (
const Constant *C = dyn_cast<Constant>(U))
652 if (
const GlobalVariable *othergv = dyn_cast<GlobalVariable>(U)) {
653 if (othergv->getName() ==
"llvm.used")
657 if (
const Instruction *instr = dyn_cast<Instruction>(U)) {
658 if (instr->getParent() && instr->getParent()->getParent()) {
660 if (oneFunc && (curFunc != oneFunc))
703 if (
const Constant *cu = dyn_cast<Constant>(U)) {
706 }
else if (
const Instruction *
I = dyn_cast<Instruction>(U)) {
713 if (seenMap.
find(caller) != seenMap.
end())
730 emitDeclaration(F, O);
734 if (
const Constant *
C = dyn_cast<Constant>(U)) {
739 emitDeclaration(F, O);
745 emitDeclaration(F, O);
750 if (!isa<Instruction>(U))
763 if (seenMap.
find(caller) != seenMap.
end()) {
764 emitDeclaration(F, O);
772 void NVPTXAsmPrinter::recordAndEmitFilenames(
Module &M) {
778 StringRef Filename = DIUnit->getFilename();
779 StringRef Dirname = DIUnit->getDirectory();
783 Filename = FullPathName;
785 if (filenameMap.find(Filename) != filenameMap.end())
787 filenameMap[Filename] = i;
788 OutStreamer->EmitDwarfFileDirective(i,
"", Filename);
798 Filename = FullPathName;
800 if (filenameMap.find(Filename) != filenameMap.end())
802 filenameMap[Filename] = i;
820 MMI = getAnalysisIfAvailable<MachineModuleInfo>();
832 emitHeader(M, OS1, STI);
840 OutStreamer->AddComment(
"Start of file scope inline assembly");
844 OutStreamer->AddComment(
"End of file scope inline assembly");
850 recordAndEmitFilenames(M);
852 GlobalsEmitted =
false;
857 void NVPTXAsmPrinter::emitGlobals(
const Module &M) {
861 emitDeclarations(M, OS2);
875 VisitGlobalVariableForEmission(
I, Globals, GVVisited, GVVisiting);
878 "Missed a global variable");
879 assert(GVVisiting.
size() == 0 &&
"Did not fully process a global variable");
882 for (
unsigned i = 0, e = Globals.
size(); i != e; ++i)
883 printModuleLevelGV(Globals[i], OS2);
893 O <<
"// Generated by LLVM NVPTX Back-End\n";
898 O <<
".version " << (PTXVersion / 10) <<
"." << (PTXVersion % 10) <<
"\n";
905 O <<
", texmode_independent";
908 O <<
", map_f64_to_f32";
916 O <<
".address_size ";
929 if (!GlobalsEmitted) {
931 GlobalsEmitted =
true;
938 int i, n = global_list.
size();
948 while (!global_list.
empty())
955 for (i = 0; i < n; i++)
956 global_list.
insert(global_list.
end(), gv_array[i]);
986 void NVPTXAsmPrinter::emitLinkageDirective(
const GlobalValue *V,
988 if (static_cast<NVPTXTargetMachine &>(TM).getDrvInterface() ==
NVPTX::CUDA) {
990 if (isa<GlobalVariable>(V)) {
1004 msg.append(
"Error: ");
1005 msg.append(
"Symbol ");
1008 msg.append(
"has unsupported appending linkage type");
1017 void NVPTXAsmPrinter::printModuleLevelGV(
const GlobalVariable *GVar,
1019 bool processDemoted) {
1063 emitPTXGlobalVariable(GVar, O);
1071 const Constant *Initializer =
nullptr;
1085 O <<
"addr_mode_" << i <<
" = ";
1091 O <<
"clamp_to_border";
1094 O <<
"clamp_to_edge";
1105 O <<
"filter_mode = ";
1120 O <<
", force_unnormalized_coords = 1";
1131 if (!strncmp(GVar->
getName().
data(),
"unrollpragma", 12))
1135 if (!strncmp(GVar->
getName().
data(),
"filename", 8))
1141 const Function *demotedFunc =
nullptr;
1143 O <<
"// " << GVar->
getName() <<
" has been demoted\n";
1144 if (localDecls.find(demotedFunc) != localDecls.end())
1145 localDecls[demotedFunc].push_back(GVar);
1147 std::vector<const GlobalVariable *> temp;
1148 temp.push_back(GVar);
1149 localDecls[demotedFunc] = temp;
1158 O <<
" .attribute(.managed)";
1172 O << getPTXFundamentalTypeStr(ETy,
false);
1183 if (!Initializer->
isNullValue() && !isa<UndefValue>(Initializer)) {
1185 printScalarConstant(Initializer, O);
1192 "' is not allowed in addrspace(" +
1198 unsigned int ElementSize = 0;
1215 if (!isa<UndefValue>(Initializer) && !Initializer->
isNullValue()) {
1216 AggBuffer aggBuffer(ElementSize, O, *
this);
1217 bufferAggregateConstant(Initializer, &aggBuffer);
1218 if (aggBuffer.numSymbols) {
1219 if (static_cast<const NVPTXTargetMachine &>(TM).
is64Bit()) {
1223 O << ElementSize / 8;
1228 O << ElementSize / 4;
1269 if (localDecls.find(f) == localDecls.end())
1272 std::vector<const GlobalVariable *> &gvars = localDecls[f];
1274 for (
unsigned i = 0, e = gvars.size(); i != e; ++i) {
1275 O <<
"\t// demoted variable\n\t";
1276 printModuleLevelGV(gvars[i], O,
true);
1280 void NVPTXAsmPrinter::emitPTXAddressSpace(
unsigned int AddressSpace,
1282 switch (AddressSpace) {
1302 NVPTXAsmPrinter::getPTXFundamentalTypeStr(
const Type *Ty,
bool useB4PTR)
const {
1308 unsigned NumBits = cast<IntegerType>(Ty)->
getBitWidth();
1311 else if (NumBits <= 64) {
1312 std::string
name =
"u";
1313 return name +
utostr(NumBits);
1325 if (static_cast<const NVPTXTargetMachine &>(TM).
is64Bit())
1339 void NVPTXAsmPrinter::emitPTXGlobalVariable(
const GlobalVariable *GVar,
1357 O << getPTXFundamentalTypeStr(ETy);
1363 int64_t ElementSize = 0;
1398 unsigned int alignStruct = 1;
1401 for (
unsigned i = 0, e = STy->getNumElements(); i != e; i++) {
1402 Type *ETy = STy->getElementType(i);
1404 if (align > alignStruct)
1405 alignStruct = align;
1419 O <<
"_param_" << paramIndex;
1422 void NVPTXAsmPrinter::printParamName(
int paramIndex,
raw_ostream &O) {
1424 O <<
"_param_" << paramIndex;
1432 unsigned paramIndex = 0;
1441 Type *Ty = I->getType();
1452 std::string sname = I->getName();
1455 O <<
"\t.param .u64 .ptr .surfref ";
1457 O <<
"\t.param .surfref ";
1459 O <<
"_param_" << paramIndex;
1463 O <<
"\t.param .u64 .ptr .texref ";
1465 O <<
"\t.param .texref ";
1467 O <<
"_param_" << paramIndex;
1471 O <<
"\t.param .u64 .ptr .samplerref ";
1473 O <<
"\t.param .samplerref ";
1475 O <<
"_param_" << paramIndex;
1491 O <<
"\t.param .align " << align <<
" .b8 ";
1492 printParamName(I, paramIndex, O);
1493 O <<
"[" << sz <<
"]";
1504 if (static_cast<NVPTXTargetMachine &>(TM).getDrvInterface() !=
1508 switch (addrSpace) {
1513 O <<
".ptr .const ";
1516 O <<
".ptr .shared ";
1519 O <<
".ptr .global ";
1524 printParamName(I, paramIndex, O);
1534 O << getPTXFundamentalTypeStr(Ty);
1536 printParamName(I, paramIndex, O);
1542 if (isa<IntegerType>(Ty)) {
1546 }
else if (isa<PointerType>(Ty))
1551 O <<
"\t.param .b" << sz <<
" ";
1553 O <<
"\t.reg .b" << sz <<
" ";
1554 printParamName(I, paramIndex, O);
1560 assert(PTy &&
"Param with byval attribute should be a pointer type");
1563 if (isABI || isKernelFunc) {
1572 O <<
"\t.param .align " << align <<
" .b8 ";
1573 printParamName(I, paramIndex, O);
1574 O <<
"[" << sz <<
"]";
1583 for (
unsigned i = 0, e = vtparts.
size(); i != e; ++i) {
1585 EVT elemtype = vtparts[i];
1586 if (vtparts[i].isVector()) {
1587 elems = vtparts[i].getVectorNumElements();
1588 elemtype = vtparts[i].getVectorElementType();
1591 for (
unsigned j = 0, je = elems; j != je; ++j) {
1595 O <<
"\t.reg .b" << sz <<
" ";
1596 printParamName(I, paramIndex, O);
1612 void NVPTXAsmPrinter::emitFunctionParamList(
const MachineFunction &MF,
1615 emitFunctionParamList(F, O);
1618 void NVPTXAsmPrinter::setAndEmitFunctionVirtualRegisters(
1635 O <<
"\t.reg .b64 \t%SP;\n";
1636 O <<
"\t.reg .b64 \t%SPL;\n";
1638 O <<
"\t.reg .b32 \t%SP;\n";
1639 O <<
"\t.reg .b32 \t%SPL;\n";
1648 for (
unsigned i = 0; i < numVRs; i++) {
1652 int n = regmap.
size();
1653 regmap.
insert(std::make_pair(vr, n + 1));
1673 int n = regmap.
size();
1677 O <<
"\t.reg " << rcname <<
" \t" << rcStr <<
"<" << (n+1)
1688 unsigned int numHex;
1705 if (hexstr.length() < numHex)
1706 O << std::string(numHex - hexstr.length(),
'0');
1711 if (
const ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) {
1715 if (
const ConstantFP *CFP = dyn_cast<ConstantFP>(CPV)) {
1716 printFPConstant(CFP, O);
1719 if (isa<ConstantPointerNull>(CPV)) {
1723 if (
const GlobalValue *GVar = dyn_cast<GlobalValue>(CPV)) {
1725 bool IsNonGenericPointer =
false;
1727 IsNonGenericPointer =
true;
1729 if (EmitGeneric && !isa<Function>(CPV) && !IsNonGenericPointer) {
1738 if (
const ConstantExpr *Cexpr = dyn_cast<ConstantExpr>(CPV)) {
1741 bool IsNonGenericPointer =
false;
1743 IsNonGenericPointer =
true;
1745 if (
const GlobalValue *GVar = dyn_cast<GlobalValue>(v)) {
1746 if (EmitGeneric && !isa<Function>(v) && !IsNonGenericPointer) {
1765 int64_t vp = (int64_t)val;
1766 for (
unsigned i = 0; i <
sizeof(
T); ++i) {
1767 p[i] = (
unsigned char)vp;
1772 int32_t *vp = (int32_t *)&val;
1773 for (
unsigned i = 0; i <
sizeof(int32_t); ++i) {
1774 p[i] = (
unsigned char)*vp;
1779 int64_t *vp = (int64_t *)&val;
1780 for (
unsigned i = 0; i <
sizeof(int64_t); ++i) {
1781 p[i] = (
unsigned char)*vp;
1786 void NVPTXAsmPrinter::bufferLEByte(
const Constant *CPV,
int Bytes,
1787 AggBuffer *aggBuffer) {
1795 aggBuffer->addZeros(s);
1799 unsigned char ptr[8];
1805 unsigned char c = (
unsigned char)cast<ConstantInt>(CPV)->getZExtValue();
1806 ConvertIntToBytes<>(ptr, c);
1807 aggBuffer->addBytes(ptr, 1, Bytes);
1809 short int16 = (short)cast<ConstantInt>(CPV)->getZExtValue();
1810 ConvertIntToBytes<>(ptr, int16);
1811 aggBuffer->addBytes(ptr, 2, Bytes);
1813 if (
const ConstantInt *constInt = dyn_cast<ConstantInt>(CPV)) {
1814 int int32 = (
int)(constInt->getZExtValue());
1815 ConvertIntToBytes<>(ptr, int32);
1816 aggBuffer->addBytes(ptr, 4, Bytes);
1818 }
else if (
const ConstantExpr *Cexpr = dyn_cast<ConstantExpr>(CPV)) {
1819 if (
const ConstantInt *constInt = dyn_cast<ConstantInt>(
1821 int int32 = (
int)(constInt->getZExtValue());
1822 ConvertIntToBytes<>(ptr, int32);
1823 aggBuffer->addBytes(ptr, 4, Bytes);
1826 if (Cexpr->getOpcode() == Instruction::PtrToInt) {
1828 aggBuffer->addSymbol(v, Cexpr->getOperand(0));
1829 aggBuffer->addZeros(4);
1835 if (
const ConstantInt *constInt = dyn_cast<ConstantInt>(CPV)) {
1836 long long int64 = (
long long)(constInt->getZExtValue());
1837 ConvertIntToBytes<>(ptr, int64);
1838 aggBuffer->addBytes(ptr, 8, Bytes);
1840 }
else if (
const ConstantExpr *Cexpr = dyn_cast<ConstantExpr>(CPV)) {
1841 if (
const ConstantInt *constInt = dyn_cast<ConstantInt>(
1843 long long int64 = (
long long)(constInt->getZExtValue());
1844 ConvertIntToBytes<>(ptr, int64);
1845 aggBuffer->addBytes(ptr, 8, Bytes);
1848 if (Cexpr->getOpcode() == Instruction::PtrToInt) {
1850 aggBuffer->addSymbol(v, Cexpr->getOperand(0));
1851 aggBuffer->addZeros(8);
1867 aggBuffer->addBytes(ptr, 4, Bytes);
1871 aggBuffer->addBytes(ptr, 8, Bytes);
1878 if (
const GlobalValue *GVar = dyn_cast<GlobalValue>(CPV)) {
1879 aggBuffer->addSymbol(GVar, GVar);
1880 }
else if (
const ConstantExpr *Cexpr = dyn_cast<ConstantExpr>(CPV)) {
1882 aggBuffer->addSymbol(v, Cexpr);
1885 aggBuffer->addZeros(s);
1892 if (isa<ConstantArray>(CPV) || isa<ConstantVector>(CPV) ||
1893 isa<ConstantStruct>(CPV) || isa<ConstantDataSequential>(CPV)) {
1895 bufferAggregateConstant(CPV, aggBuffer);
1896 if (Bytes > ElementSize)
1897 aggBuffer->addZeros(Bytes - ElementSize);
1898 }
else if (isa<ConstantAggregateZero>(CPV))
1899 aggBuffer->addZeros(Bytes);
1910 void NVPTXAsmPrinter::bufferAggregateConstant(
const Constant *CPV,
1911 AggBuffer *aggBuffer) {
1916 if (isa<ConstantArray>(CPV) || isa<ConstantVector>(CPV)) {
1919 bufferLEByte(cast<Constant>(CPV->
getOperand(i)), 0, aggBuffer);
1924 dyn_cast<ConstantDataSequential>(CPV)) {
1925 if (CDS->getNumElements())
1926 for (
unsigned i = 0; i < CDS->getNumElements(); ++i)
1927 bufferLEByte(cast<Constant>(CDS->getElementAsConstant(i)), 0,
1932 if (isa<ConstantStruct>(CPV)) {
1943 bufferLEByte(cast<Constant>(CPV->
getOperand(i)), Bytes, aggBuffer);
1954 bool NVPTXAsmPrinter::isImageType(
const Type *Ty) {
1956 std::map<const Type *, std::string>::iterator PI = TypeNameMap.find(Ty);
1958 if (PI != TypeNameMap.end() && (!PI->second.compare(
"struct._image1d_t") ||
1959 !PI->second.compare(
"struct._image2d_t") ||
1960 !PI->second.compare(
"struct._image3d_t")))
1971 case NVPTX::CallArgBeginInst:
1972 case NVPTX::CallArgEndInst0:
1973 case NVPTX::CallArgEndInst1:
1974 case NVPTX::CallArgF32:
1975 case NVPTX::CallArgF64:
1976 case NVPTX::CallArgI16:
1977 case NVPTX::CallArgI32:
1978 case NVPTX::CallArgI32imm:
1979 case NVPTX::CallArgI64:
1980 case NVPTX::CallArgParam:
1981 case NVPTX::CallVoidInst:
1982 case NVPTX::CallVoidInstReg:
1983 case NVPTX::Callseq_End:
1984 case NVPTX::CallVoidInstReg64:
1985 case NVPTX::DeclareParamInst:
1986 case NVPTX::DeclareRetMemInst:
1987 case NVPTX::DeclareRetRegInst:
1988 case NVPTX::DeclareRetScalarInst:
1989 case NVPTX::DeclareScalarParamInst:
1990 case NVPTX::DeclareScalarRegInst:
1991 case NVPTX::StoreParamF32:
1992 case NVPTX::StoreParamF64:
1993 case NVPTX::StoreParamI16:
1994 case NVPTX::StoreParamI32:
1995 case NVPTX::StoreParamI64:
1996 case NVPTX::StoreParamI8:
1997 case NVPTX::StoreRetvalF32:
1998 case NVPTX::StoreRetvalF64:
1999 case NVPTX::StoreRetvalI16:
2000 case NVPTX::StoreRetvalI32:
2001 case NVPTX::StoreRetvalI64:
2002 case NVPTX::StoreRetvalI8:
2003 case NVPTX::LastCallArgF32:
2004 case NVPTX::LastCallArgF64:
2005 case NVPTX::LastCallArgI16:
2006 case NVPTX::LastCallArgI32:
2007 case NVPTX::LastCallArgI32imm:
2008 case NVPTX::LastCallArgI64:
2009 case NVPTX::LastCallArgParam:
2010 case NVPTX::LoadParamMemF32:
2011 case NVPTX::LoadParamMemF64:
2012 case NVPTX::LoadParamMemI16:
2013 case NVPTX::LoadParamMemI32:
2014 case NVPTX::LoadParamMemI64:
2015 case NVPTX::LoadParamMemI8:
2016 case NVPTX::PrototypeInst:
2028 NVPTXAsmPrinter::lowerConstantForGV(
const Constant *CV,
bool ProcessingGeneric) {
2034 if (
const ConstantInt *CI = dyn_cast<ConstantInt>(CV))
2037 if (
const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
2040 if (ProcessingGeneric) {
2059 return lowerConstantForGV(
C, ProcessingGeneric);
2065 OS <<
"Unsupported expression in static initializer: ";
2071 case Instruction::AddrSpaceCast: {
2075 return lowerConstantForGV(cast<const Constant>(CE->
getOperand(0)),
true);
2079 OS <<
"Unsupported expression in static initializer: ";
2085 case Instruction::GetElementPtr: {
2090 cast<GEPOperator>(CE)->accumulateConstantOffset(DL, OffsetAI);
2097 int64_t Offset = OffsetAI.getSExtValue();
2102 case Instruction::Trunc:
2108 case Instruction::BitCast:
2109 return lowerConstantForGV(CE->
getOperand(0), ProcessingGeneric);
2111 case Instruction::IntToPtr: {
2119 return lowerConstantForGV(Op, ProcessingGeneric);
2122 case Instruction::PtrToInt: {
2130 const MCExpr *OpExpr = lowerConstantForGV(Op, ProcessingGeneric);
2147 case Instruction::Add: {
2148 const MCExpr *LHS = lowerConstantForGV(CE->
getOperand(0), ProcessingGeneric);
2149 const MCExpr *RHS = lowerConstantForGV(CE->
getOperand(1), ProcessingGeneric);
2162 return cast<MCTargetExpr>(&Expr)->printImpl(OS,
MAI);
2164 OS << cast<MCConstantExpr>(Expr).getValue();
2190 if (isa<MCConstantExpr>(BE.
getLHS()) || isa<MCSymbolRefExpr>(BE.
getLHS()) ||
2191 isa<NVPTXGenericMCSymbolRefExpr>(BE.
getLHS())) {
2192 printMCExpr(*BE.
getLHS(), OS);
2195 printMCExpr(*BE.
getLHS(), OS);
2203 if (RHSC->getValue() < 0) {
2204 OS << RHSC->getValue();
2215 if (isa<MCConstantExpr>(BE.
getRHS()) || isa<MCSymbolRefExpr>(BE.
getRHS())) {
2216 printMCExpr(*BE.
getRHS(), OS);
2219 printMCExpr(*BE.
getRHS(), OS);
2231 bool NVPTXAsmPrinter::PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
2232 unsigned AsmVariant,
2234 if (ExtraCode && ExtraCode[0]) {
2235 if (ExtraCode[1] != 0)
2238 switch (ExtraCode[0]) {
2247 printOperand(MI, OpNo, O);
2252 bool NVPTXAsmPrinter::PrintAsmMemoryOperand(
2253 const MachineInstr *MI,
unsigned OpNo,
unsigned AsmVariant,
2255 if (ExtraCode && ExtraCode[0])
2259 printMemOperand(MI, OpNo, O);
2265 void NVPTXAsmPrinter::printOperand(
const MachineInstr *MI,
int opNum,
2271 if (MO.
getReg() == NVPTX::VRDepot)
2276 emitVirtualRegister(MO.
getReg(), O);
2283 else if (strstr(Modifier,
"vec") == Modifier)
2284 printVecModifiedImmediate(MO, Modifier, O);
2287 "Don't know how to handle modifier on immediate operand");
2307 void NVPTXAsmPrinter::printMemOperand(
const MachineInstr *MI,
int opNum,
2309 printOperand(MI, opNum, O);
2311 if (Modifier && !strcmp(Modifier,
"add")) {
2313 printOperand(MI, opNum + 1, O);
2319 printOperand(MI, opNum + 1, O);
2324 std::stringstream temp;
2325 LineReader *reader = this->getReader(filename);
2327 temp << filename.
str();
2336 LineReader *NVPTXAsmPrinter::getReader(std::string filename) {
2350 if (lineNum < theCurLine) {
2352 fstr.seekg(0, std::ios::beg);
2354 while (theCurLine < lineNum) {
2355 fstr.getline(buff, 500);
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type (if unknown returns 0).
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
static const NVPTXFloatMCExpr * createConstantFPDouble(APFloat Flt, MCContext &Ctx)
void push_back(const T &Elt)
bool doesSupportDebugInformation() const
A parsed version of the target data layout string in and methods for querying it. ...
static cl::opt< bool > InterleaveSrc("nvptx-emit-src", cl::ZeroOrMore, cl::Hidden, cl::desc("NVPTX Specific: Emit source line in ptx file"), cl::init(false))
StringRef getTargetCPU() const
static Type * getDoubleTy(LLVMContext &C)
const GlobalValue * getGlobal() const
uint64_t getZExtValue() const
Get zero extended value.
const MCSymbol & getSymbol() const
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
MCSymbol * getSymbol(const GlobalValue *GV) const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
std::string getSurfaceName(const llvm::Value &)
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
MDNode * getScope() const
bool getReqNTIDy(const llvm::Function &, unsigned &)
static const fltSemantics IEEEdouble
const ConstantFP * getFPImm() const
MachineBasicBlock * getMBB() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
static unsigned index2VirtReg(unsigned Index)
index2VirtReg - Convert a 0-based index to a virtual register number.
A Module instance is used to store all the information related to an LLVM module. ...
const DataLayout & getDataLayout() const
Return information about data layout.
2: 32-bit floating point type
bool doFinalization(Module &M) override
Shut down the asmprinter.
MCContext & OutContext
This is the context for the output file that we are streaming.
static MCOperand createExpr(const MCExpr *Val)
DenseSet - This implements a dense probed hash-table based set.
const GlobalListType & getGlobalList() const
Get the Module's list of global variables (constant).
unsigned getNumOperands() const
unsigned getPointerTypeSizeInBits(Type *) const
Layout pointer size, in bits, based on the type.
unsigned getPrefTypeAlignment(Type *Ty) const
Returns the preferred stack/global alignment for the specified type.
Describe properties that are true of each instruction in the target description file.
static bool isVirtualRegister(unsigned Reg)
isVirtualRegister - Return true if the specified register number is in the virtual register namespace...
bool hasAppendingLinkage() const
unsigned getPointerPrefAlignment(unsigned AS=0) const
Return target's alignment for stack-based pointers FIXME: The defaults need to be removed once all of...
const MachineFunction * MF
The current machine function.
unsigned getSizeInBits() const
bool hasAvailableExternallyLinkage() const
std::string str() const
str - Get the contents as an std::string.
A raw_ostream that writes to an SmallVector or SmallString.
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
Type * getReturnType() const
bool isSurface(const llvm::Value &)
MachineBasicBlock reference.
const Function * getParent() const
Return the enclosing method, or null if none.
bool isKernelFunction(const llvm::Function &)
unsigned getFunctionNumber() const
Return a unique ID for the current function.
const char * getSymbolName() const
unsigned getParamAlignment(unsigned Index) const
Return the alignment for the specified function parameter.
static const MCBinaryExpr * createAnd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
unsigned getAddressSpace() const
Return the address space of the Pointer type.
static IntegerType * getInt64Ty(LLVMContext &C)
static IntegerType * getInt16Ty(LLVMContext &C)
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
Constant * ConstantFoldConstantExpression(const ConstantExpr *CE, const DataLayout &DL, const TargetLibraryInfo *TLI=nullptr)
ConstantFoldConstantExpression - Attempt to fold the constant expression using the specified DataLayo...
unsigned getOpcode() const
getOpcode - Return the opcode at the root of this constant expression
std::string getVirtualRegisterName(unsigned) const
std::string getTextureName(const llvm::Value &)
void processModule(const Module &M)
Process entire module and collect debug info anchors.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
uint64_t getTypeAllocSizeInBits(Type *Ty) const
Returns the offset in bits between successive objects of the specified type, including alignment padd...
StringRef getName() const
Return a constant reference to the value's name.
unsigned getMaxAlignment() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
const Triple & getTargetTriple() const
bool isSingleValueType() const
isSingleValueType - Return true if the type is a valid type for a register in codegen.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...
std::string readLine(unsigned line)
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
bool getMaxNTIDz(const llvm::Function &, unsigned &)
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
static Constant * getIntegerCast(Constant *C, Type *Ty, bool isSigned)
Create a ZExt, Bitcast or Trunc for integer -> integer casts.
bool hasCommonLinkage() const
unsigned getNumRegClasses() const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
static MCOperand createReg(unsigned Reg)
bool isManaged(const llvm::Value &)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
bool erase(const ValueT &V)
static Type * getFloatTy(LLVMContext &C)
const APInt & getValue() const
Return the constant as an APInt value reference.
static bool usedInOneFunc(const User *U, Function const *&oneFunc)
StructType - Class to represent struct types.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const TargetRegisterClass * getRegClass(unsigned i) const
getRegClass - Returns the register class associated with the enumeration value.
bool hasInternalLinkage() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Base class for the full range of assembler expressions which are needed for parsing.
const TargetRegisterClass * getRegClass(unsigned Reg) const
getRegClass - Return the register class of the specified virtual register.
Name of external global symbol.
Utility to find all debug info in a module.
Reg
All possible values of the reg field in the ModR/M byte.
bool getReqNTIDx(const llvm::Function &, unsigned &)
Represent a reference to a symbol from inside an expression.
bool is_absolute(const Twine &path)
Is path absolute?
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
const char * getImageHandleSymbol(unsigned Idx) const
Returns the symbol name at the given index.
Windows NT (Windows on ARM)
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
bool isInteger() const
isInteger - Return true if this is an integer, or a vector integer type.
bool hasPrivateLinkage() const
unsigned getNumOperands() const
Access to explicit operands of the instruction.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
global_iterator global_begin()
bool ignoreLoc(const MachineInstr &)
Context object for machine code objects.
ConstantExpr - a constant value that is initialized with an expression using other constant values...
FunctionType - Class to represent function types.
Mangler * Mang
Name-mangler for global names.
unsigned int getSmVersion() const
static const NVPTXFloatMCExpr * createConstantFPSingle(APFloat Flt, MCContext &Ctx)
ConstantDataSequential - A vector or array constant whose element type is a simple 1/2/4/8-byte integ...
const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
void printAsOperand(raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
Print the name of this Value out to the specified raw_ostream.
unsigned getAlignment() const
Unary assembler expressions.
ArrayType - Class to represent array types.
static std::string utostr(uint64_t X, bool isNeg=false)
double convertToDouble() const
TypeID getTypeID() const
getTypeID - Return the type id for the type.
bool isFloatingPointTy() const
isFloatingPointTy - Return true if this is one of the six floating point types
iterator_range< compile_unit_iterator > compile_units() const
bool isImageReadWrite(const llvm::Value &)
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Type * getElementType() const
void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< uint64_t > *Offsets=nullptr, uint64_t StartingOffset=0)
ComputeValueVTs - Given an LLVM IR type, compute a sequence of EVTs that represent all the individual...
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
Instances of this class represent a single low-level machine instruction.
static const NVPTXGenericMCSymbolRefExpr * create(const MCSymbolRefExpr *SymExpr, MCContext &Ctx)
PointerType - Class to represent pointers.
const BasicBlock * getBasicBlock() const
getBasicBlock - Return the LLVM basic block that this instance corresponded to originally.
iterator_range< subprogram_iterator > subprograms() const
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
uint64_t getElementOffset(unsigned Idx) const
10: Arbitrary bit width integers
DBG_VALUE - a mapping of the llvm.dbg.value intrinsic.
MachineLoop * getLoopFor(const MachineBasicBlock *BB) const
getLoopFor - Return the inner most loop that BB lives in.
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
void clearAnnotationCache(const llvm::Module *)
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
StringRef filename(StringRef path)
Get filename.
Address of a global value.
initializer< Ty > init(const Ty &Val)
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
bool getMaxNTIDy(const llvm::Function &, unsigned &)
MCSymbol * CurrentFnSym
The symbol for the current function.
MVT - Machine Value Type.
LLVM Basic Block Representation.
const MCAsmInfo * MAI
Target Asm Printer information.
The instances of the Type class are immutable: once they are created, they are never changed...
size_type count(const ValueT &V) const
Return 1 if the specified key is in the set, 0 otherwise.
bool isVectorTy() const
isVectorTy - True if this is an instance of VectorType.
size_type LLVM_ATTRIBUTE_UNUSED_RESULT size() const
This is an important base class in LLVM.
static bool is64Bit(const char *name)
bool isImageWriteOnly(const llvm::Value &)
const MachineOperand & getOperand(unsigned i) const
const NVPTXTargetLowering * getTargetLowering() const override
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant...
ConstantFP - Floating Point Values [float, double].
TargetMachine & TM
Target machine description.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static const char * getRegisterName(unsigned RegNo)
iterator insert(iterator where, NodeTy *New)
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
opStatus convert(const fltSemantics &, roundingMode, bool *)
APFloat::convert - convert a value of one floating point type to another.
ManagedStringPool * getManagedStrPool() const
Value * getOperand(unsigned i) const
Class to represent integer types.
void emitLineNumberAsDotLoc(const MachineInstr &)
bool getReqNTIDz(const llvm::Function &, unsigned &)
EVT - Extended Value Type.
bool isPointerTy() const
isPointerTy - True if this is an instance of PointerType.
bool hasWeakLinkage() const
Binary assembler expressions.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
pred_iterator pred_begin()
LLVMContext & getContext() const
All values hold a context through their type.
MCSymbol * getSymbol() const
getSymbol - Return the MCSymbol for this basic block.
static bool useFuncSeen(const Constant *C, llvm::DenseMap< const Function *, bool > &seenMap)
Triple - Helper class for working with autoconf configuration names.
const std::string & getModuleInlineAsm() const
Get any module-scope inline assembly blocks.
global_iterator global_end()
static cl::opt< bool > EmitLineNumbers("nvptx-emit-line-numbers", cl::Hidden, cl::desc("NVPTX Specific: Emit Line numbers even without -G"), cl::init(true))
const char * getSection() const
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
bool hasExternalLinkage() const
std::pair< iterator, bool > insert(const ValueT &V)
void setOpcode(unsigned Op)
bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
This is the shared class of boolean and integer constants.
static void ConvertFloatToBytes(unsigned char *p, float val)
std::string * getManagedString(const char *S)
StringRef getTargetFeatureString() const
15: SIMD 'packed' format, or other vector type
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
const DataLayout * getDataLayout() const
Deprecated in 3.7, will be removed in 3.8.
const MCExpr * lowerConstant(const Constant *CV)
Lower the specified LLVM Constant to an MCExpr.
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
bool getAlign(const llvm::Function &, unsigned index, unsigned &)
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
std::string getTargetName() const
Value * stripPointerCasts()
Strip off pointer casts, all-zero GEPs, and aliases.
MachineFrameInfo * getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
bool isNullValue() const
isNullValue - Return true if this is the value that would be returned by getNullValue.
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
AttributeSet getAttributes() const
Return the attribute list for this Function.
bool getMinCTASm(const llvm::Function &, unsigned &)
virtual void EmitBasicBlockStart(const MachineBasicBlock &MBB) const
Targets can override this to emit stuff at the start of a basic block.
Class for arbitrary precision integers.
bool hasInitializer() const
Definitions have initializers, declarations don't.
bool isIntegerTy() const
isIntegerTy - True if this is an instance of IntegerType.
iterator_range< user_iterator > users()
bool isImage(const llvm::Value &)
APInt bitcastToAPInt() const
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
MDNode * GetUnrollMetadata(MDNode *LoopID, StringRef Name)
Given an llvm.loop loop id metadata node, returns the loop hint metadata node with the given name (fo...
bool isSampler(const llvm::Value &)
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
StringRef str()
Flushes the stream contents to the target vector and return a StringRef for the vector contents...
bool hasLinkOnceLinkage() const
Representation of each machine instruction.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
static bool isPhysicalRegister(unsigned Reg)
isPhysicalRegister - Return true if the specified register number is in the physical register namespa...
PointerType * getType() const
Global values are always pointers.
static const fltSemantics IEEEsingle
const MCExpr * getSubExpr() const
Get the child of this unary expression.
bool isAggregateType() const
isAggregateType - Return true if the type is an aggregate type.
std::string getNVPTXRegClassStr(TargetRegisterClass const *RC)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
static IntegerType * getInt32Ty(LLVMContext &C)
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
static bool usedInGlobalVarDef(const Constant *C)
std::string getSamplerName(const llvm::Value &)
unsigned getSizeInBits() const
getSizeInBits - Return the size of the specified value type in bits.
Opcode getOpcode() const
Get the kind of this binary expression.
std::string getNVPTXRegClassName(TargetRegisterClass const *RC)
static unsigned int getOpenCLAlignment(const DataLayout *TD, Type *Ty)
iterator find(const KeyT &Val)
float convertToFloat() const
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
References to labels and assigned expressions.
uint64_t getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type...
static bool canDemoteGlobalVar(const GlobalVariable *gv, Function const *&f)
bool isLoopHeader(const MachineBasicBlock *BB) const
static std::string utohexstr(uint64_t X, bool LowerCase=false)
const APFloat & getValueAPF() const
3: 64-bit floating point type
unsigned getReg() const
getReg - Returns the register number.
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
bool isTexture(const llvm::Value &)
bool hasImageHandles() const
A raw_ostream that writes to an std::string.
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
getPrimitiveSizeInBits - Return the basic size of this type if it is a primitive type.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
Floating-point immediate operand.
RegisterAsmPrinter - Helper template for registering a target specific assembly printer, for use in the target machine initialization function.
This class implements an extremely fast bulk output stream that can only output to a stream...
Primary interface to the complete machine description for the target machine.
static void ConvertDoubleToBytes(unsigned char *p, double val)
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
void addOperand(const MCOperand &Op)
virtual void print(raw_ostream &O, const Module *M) const
print - Print out the internal state of the pass.
StringRef - Represent a constant reference to a string, i.e.
Target specific expression.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
static void ConvertIntToBytes(unsigned char *p, T val)
bool getMaxNTIDx(const llvm::Function &, unsigned &)
Instances of this class represent operands of the MCInst class.
MCSymbol * GetExternalSymbolSymbol(StringRef Sym) const
Return the MCSymbol for the specified ExternalSymbol.
NodeTy * remove(iterator &IT)
static MCOperand createImm(int64_t Val)
static IntegerType * getInt8Ty(LLVMContext &C)
const BasicBlock * getParent() const
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
NVPTX::DrvInterface getDrvInterface() const
void LLVMInitializeNVPTXAsmPrinter()
bool doFinalization(Module &M) override
Shut down the asmprinter.
unsigned getPTXVersion() const
const NVPTXRegisterInfo * getRegisterInfo() const override
bool empty() const
empty - Check if the string is empty.
Opcode getOpcode() const
Get the kind of this unary expression.
const char * getName(unsigned RegNo) const