99 cl::desc(
"Lower GPU ctor / dtors to globals on the device."),
102#define DEPOTNAME "__local_depot"
112 if (
const User *U = dyn_cast<User>(V)) {
113 for (
unsigned i = 0, e = U->getNumOperands(); i != e; ++i) {
129 if (Visited.
count(GV))
133 if (!Visiting.
insert(GV).second)
151 NVPTX_MC::verifyInstructionPredicates(
MI->getOpcode(),
155 lowerToMCInst(
MI, Inst);
160bool NVPTXAsmPrinter::lowerImageHandleOperand(
const MachineInstr *
MI,
168 if (OpNo == 4 && MO.
isImm()) {
169 lowerImageHandleSymbol(MO.
getImm(), MCOp);
173 lowerImageHandleSymbol(MO.
getImm(), MCOp);
183 if (OpNo == VecSize && MO.
isImm()) {
184 lowerImageHandleSymbol(MO.
getImm(), MCOp);
191 if (OpNo == 0 && MO.
isImm()) {
192 lowerImageHandleSymbol(MO.
getImm(), MCOp);
199 if (OpNo == 1 && MO.
isImm()) {
200 lowerImageHandleSymbol(MO.
getImm(), MCOp);
210void NVPTXAsmPrinter::lowerImageHandleSymbol(
unsigned Index,
MCOperand &MCOp) {
223 if (
MI->getOpcode() == NVPTX::CALL_PROTOTYPE) {
231 for (
unsigned i = 0, e =
MI->getNumOperands(); i !=
e; ++i) {
236 if (lowerImageHandleOperand(
MI, i, MCOp)) {
242 if (lowerOperand(MO, MCOp))
296unsigned NVPTXAsmPrinter::encodeVirtualRegister(
unsigned Reg) {
301 unsigned RegNum = RegMap[
Reg];
306 if (RC == &NVPTX::Int1RegsRegClass) {
308 }
else if (RC == &NVPTX::Int16RegsRegClass) {
310 }
else if (RC == &NVPTX::Int32RegsRegClass) {
312 }
else if (RC == &NVPTX::Int64RegsRegClass) {
314 }
else if (RC == &NVPTX::Float32RegsRegClass) {
316 }
else if (RC == &NVPTX::Float64RegsRegClass) {
318 }
else if (RC == &NVPTX::Int128RegsRegClass) {
325 Ret |= (RegNum & 0x0FFFFFFF);
330 return Reg & 0x0FFFFFFF;
351 Type *Ty =
F->getReturnType();
363 if (
auto *ITy = dyn_cast<IntegerType>(Ty)) {
364 size = ITy->getBitWidth();
370 O <<
".param .b" <<
size <<
" func_retval0";
371 }
else if (isa<PointerType>(Ty)) {
372 O <<
".param .b" << TLI->getPointerTy(
DL).getSizeInBits()
375 unsigned totalsz =
DL.getTypeAllocSize(Ty);
376 Align RetAlignment = TLI->getFunctionArgumentAlignment(
378 O <<
".param .align " << RetAlignment.
value() <<
" .b8 func_retval0["
386 for (
unsigned i = 0, e = vtparts.
size(); i != e; ++i) {
388 EVT elemtype = vtparts[i];
390 elems = vtparts[i].getVectorNumElements();
391 elemtype = vtparts[i].getVectorElementType();
394 for (
unsigned j = 0, je = elems;
j != je; ++
j) {
398 O <<
".reg .b" << sz <<
" func_retval" << idx;
413 printReturnValStr(&F, O);
418bool NVPTXAsmPrinter::isLoopHeaderOfNoUnroll(
420 MachineLoopInfo &LI = getAnalysis<MachineLoopInfoWrapperPass>().getLI();
433 if (
const BasicBlock *PBB = PMBB->getBasicBlock()) {
435 PBB->getTerminator()->getMetadata(LLVMContext::MD_loop)) {
438 if (
MDNode *UnrollCountMD =
440 if (mdconst::extract<ConstantInt>(UnrollCountMD->getOperand(1))
452 if (isLoopHeaderOfNoUnroll(
MBB))
456void NVPTXAsmPrinter::emitFunctionEntryLabel() {
460 if (!GlobalsEmitted) {
462 GlobalsEmitted =
true;
468 emitLinkageDirective(F, O);
473 printReturnValStr(*
MF, O);
478 emitFunctionParamList(F, O);
482 emitKernelFunctionDirectives(*F, O);
492 setAndEmitFunctionVirtualRegisters(*
MF);
512void NVPTXAsmPrinter::emitFunctionBodyStart() {
519void NVPTXAsmPrinter::emitFunctionBodyEnd() {
529void NVPTXAsmPrinter::emitImplicitDef(
const MachineInstr *
MI)
const {
542void NVPTXAsmPrinter::emitKernelFunctionDirectives(
const Function &
F,
551 if (Reqntidx || Reqntidy || Reqntidz)
552 O <<
".reqntid " << Reqntidx.value_or(1) <<
", " << Reqntidy.value_or(1)
553 <<
", " << Reqntidz.value_or(1) <<
"\n";
562 if (Maxntidx || Maxntidy || Maxntidz)
563 O <<
".maxntid " << Maxntidx.value_or(1) <<
", " << Maxntidy.value_or(1)
564 <<
", " << Maxntidz.value_or(1) <<
"\n";
568 O <<
".minnctapersm " << Mincta <<
"\n";
570 unsigned Maxnreg = 0;
572 O <<
".maxnreg " << Maxnreg <<
"\n";
578 unsigned Maxclusterrank = 0;
580 O <<
".maxclusterrank " << Maxclusterrank <<
"\n";
590 assert(
I != VRegMapping.
end() &&
"Bad register class");
594 assert(VI != RegMap.
end() &&
"Bad virtual register");
595 unsigned MappedVR = VI->second;
603void NVPTXAsmPrinter::emitVirtualRegister(
unsigned int vr,
608void NVPTXAsmPrinter::emitAliasDeclaration(
const GlobalAlias *GA,
613 "NVPTX aliasee must be a non-kernel function definition");
619 emitDeclarationWithName(F,
getSymbol(GA), O);
623 emitDeclarationWithName(F,
getSymbol(F), O);
628 emitLinkageDirective(F, O);
633 printReturnValStr(F, O);
636 emitFunctionParamList(F, O);
648 return GV->getName() !=
"llvm.used";
651 for (
const User *U :
C->users())
652 if (
const Constant *
C = dyn_cast<Constant>(U))
660 if (
const GlobalVariable *othergv = dyn_cast<GlobalVariable>(U)) {
661 if (othergv->getName() ==
"llvm.used")
666 if (
instr->getParent() &&
instr->getParent()->getParent()) {
668 if (oneFunc && (curFunc != oneFunc))
676 for (
const User *UU : U->users())
710 for (
const User *U :
C->users()) {
711 if (
const Constant *cu = dyn_cast<Constant>(U)) {
714 }
else if (
const Instruction *
I = dyn_cast<Instruction>(U)) {
731 if (
F.getAttributes().hasFnAttr(
"nvptx-libcall-callee")) {
732 emitDeclaration(&F, O);
736 if (
F.isDeclaration()) {
739 if (
F.getIntrinsicID())
741 emitDeclaration(&F, O);
744 for (
const User *U :
F.users()) {
745 if (
const Constant *
C = dyn_cast<Constant>(U)) {
750 emitDeclaration(&F, O);
756 emitDeclaration(&F, O);
761 if (!isa<Instruction>(U))
775 emitDeclaration(&F, O);
782 emitAliasDeclaration(&GA, O);
786 if (!GV)
return true;
788 if (!InitList)
return true;
792void NVPTXAsmPrinter::emitStartOfAsmFile(
Module &M) {
802 emitHeader(M, OS1, *STI);
814 bool IsOpenMP = M.getModuleFlag(
"openmp") !=
nullptr;
819 "Module has a nontrivial global ctor, which NVPTX does not support.");
825 "Module has a nontrivial global dtor, which NVPTX does not support.");
832 GlobalsEmitted =
false;
837void NVPTXAsmPrinter::emitGlobals(
const Module &M) {
841 emitDeclarations(M, OS2);
856 assert(GVVisited.
size() == M.global_size() &&
"Missed a global variable");
857 assert(GVVisiting.
size() == 0 &&
"Did not fully process a global variable");
865 printModuleLevelGV(GV, OS2,
false, STI);
887 O <<
"// Generated by LLVM NVPTX Back-End\n";
892 O <<
".version " << (PTXVersion / 10) <<
"." << (PTXVersion % 10) <<
"\n";
899 O <<
", texmode_independent";
901 bool HasFullDebugInfo =
false;
903 switch(
CU->getEmissionKind()) {
909 HasFullDebugInfo =
true;
912 if (HasFullDebugInfo)
920 O <<
".address_size ";
935 if (!GlobalsEmitted) {
937 GlobalsEmitted =
true;
951 OutStreamer->emitRawText(
"\t.section\t.debug_loc\t{\t}");
955 TS->outputDwarfFileDirectives();
973void NVPTXAsmPrinter::emitLinkageDirective(
const GlobalValue *V,
976 if (V->hasExternalLinkage()) {
977 if (isa<GlobalVariable>(V)) {
985 }
else if (
V->isDeclaration())
989 }
else if (
V->hasAppendingLinkage()) {
991 msg.append(
"Error: ");
992 msg.append(
"Symbol ");
994 msg.append(std::string(
V->getName()));
995 msg.append(
"has unsupported appending linkage type");
997 }
else if (!
V->hasInternalLinkage() &&
998 !
V->hasPrivateLinkage()) {
1004void NVPTXAsmPrinter::printModuleLevelGV(
const GlobalVariable *GVar,
1051 emitPTXGlobalVariable(GVar, O, STI);
1059 const Constant *Initializer =
nullptr;
1064 CI = dyn_cast<ConstantInt>(Initializer);
1073 O <<
"addr_mode_" << i <<
" = ";
1079 O <<
"clamp_to_border";
1082 O <<
"clamp_to_edge";
1093 O <<
"filter_mode = ";
1108 O <<
", force_unnormalized_coords = 1";
1118 if (strncmp(GVar->
getName().
data(),
"unrollpragma", 12) == 0)
1122 if (strncmp(GVar->
getName().
data(),
"filename", 8) == 0)
1128 const Function *demotedFunc =
nullptr;
1130 O <<
"// " << GVar->
getName() <<
" has been demoted\n";
1131 if (localDecls.find(demotedFunc) != localDecls.end())
1132 localDecls[demotedFunc].push_back(GVar);
1134 std::vector<const GlobalVariable *> temp;
1135 temp.push_back(GVar);
1136 localDecls[demotedFunc] = temp;
1147 ".attribute(.managed) requires PTX version >= 4.0 and sm_30");
1149 O <<
" .attribute(.managed)";
1153 O <<
" .align " <<
A->value();
1155 O <<
" .align " << (int)
DL.getPrefTypeAlign(ETy).value();
1164 O << getPTXFundamentalTypeStr(ETy,
false);
1175 if (!Initializer->
isNullValue() && !isa<UndefValue>(Initializer)) {
1177 printScalarConstant(Initializer, O);
1186 "' is not allowed in addrspace(" +
1203 ElementSize =
DL.getTypeStoreSize(ETy);
1210 if (!isa<UndefValue>(Initializer) && !Initializer->
isNullValue()) {
1211 AggBuffer aggBuffer(ElementSize, *
this);
1212 bufferAggregateConstant(Initializer, &aggBuffer);
1213 if (aggBuffer.numSymbols()) {
1215 if (ElementSize % ptrSize ||
1216 !aggBuffer.allSymbolsAligned(ptrSize)) {
1220 "initialized packed aggregate with pointers '" +
1222 "' requires at least PTX ISA version 7.1");
1225 O <<
"[" << ElementSize <<
"] = {";
1226 aggBuffer.printBytes(O);
1229 O <<
" .u" << ptrSize * 8 <<
" ";
1231 O <<
"[" << ElementSize / ptrSize <<
"] = {";
1232 aggBuffer.printWords(O);
1238 O <<
"[" << ElementSize <<
"] = {";
1239 aggBuffer.printBytes(O);
1268void NVPTXAsmPrinter::AggBuffer::printSymbol(
unsigned nSym,
raw_ostream &os) {
1269 const Value *
v = Symbols[nSym];
1270 const Value *v0 = SymbolsBeforeStripping[nSym];
1271 if (
const GlobalValue *GVar = dyn_cast<GlobalValue>(v)) {
1275 bool isGenericPointer = PTy && PTy->getAddressSpace() == 0;
1276 if (EmitGeneric && isGenericPointer && !isa<Function>(v)) {
1278 Name->print(os, AP.MAI);
1281 Name->print(os, AP.MAI);
1283 }
else if (
const ConstantExpr *CExpr = dyn_cast<ConstantExpr>(v0)) {
1284 const MCExpr *Expr = AP.lowerConstantForGV(cast<Constant>(CExpr),
false);
1285 AP.printMCExpr(*Expr, os);
1290void NVPTXAsmPrinter::AggBuffer::printBytes(
raw_ostream &os) {
1291 unsigned int ptrSize = AP.MAI->getCodePointerSize();
1296 unsigned int InitializerCount =
size;
1299 if (numSymbols() == 0)
1300 while (InitializerCount >= 1 && !buffer[InitializerCount - 1])
1303 symbolPosInBuffer.push_back(InitializerCount);
1304 unsigned int nSym = 0;
1305 unsigned int nextSymbolPos = symbolPosInBuffer[nSym];
1306 for (
unsigned int pos = 0; pos < InitializerCount;) {
1309 if (pos != nextSymbolPos) {
1310 os << (
unsigned int)buffer[pos];
1317 std::string symText;
1319 printSymbol(nSym, oss);
1320 for (
unsigned i = 0; i < ptrSize; ++i) {
1324 os <<
"(" << symText <<
")";
1327 nextSymbolPos = symbolPosInBuffer[++nSym];
1328 assert(nextSymbolPos >= pos);
1332void NVPTXAsmPrinter::AggBuffer::printWords(
raw_ostream &os) {
1333 unsigned int ptrSize = AP.MAI->getCodePointerSize();
1334 symbolPosInBuffer.push_back(size);
1335 unsigned int nSym = 0;
1336 unsigned int nextSymbolPos = symbolPosInBuffer[nSym];
1337 assert(nextSymbolPos % ptrSize == 0);
1338 for (
unsigned int pos = 0; pos <
size; pos += ptrSize) {
1341 if (pos == nextSymbolPos) {
1342 printSymbol(nSym, os);
1343 nextSymbolPos = symbolPosInBuffer[++nSym];
1344 assert(nextSymbolPos % ptrSize == 0);
1345 assert(nextSymbolPos >= pos + ptrSize);
1346 }
else if (ptrSize == 4)
1354 if (localDecls.find(f) == localDecls.end())
1357 std::vector<const GlobalVariable *> &gvars = localDecls[
f];
1364 O <<
"\t// demoted variable\n\t";
1365 printModuleLevelGV(GV, O,
true, STI);
1369void NVPTXAsmPrinter::emitPTXAddressSpace(
unsigned int AddressSpace,
1392NVPTXAsmPrinter::getPTXFundamentalTypeStr(
Type *Ty,
bool useB4PTR)
const {
1395 unsigned NumBits = cast<IntegerType>(Ty)->getBitWidth();
1398 else if (NumBits <= 64) {
1399 std::string
name =
"u";
1400 return name + utostr(NumBits);
1418 assert((PtrSize == 64 || PtrSize == 32) &&
"Unexpected pointer size");
1436void NVPTXAsmPrinter::emitPTXGlobalVariable(
const GlobalVariable *GVar,
1449 ".attribute(.managed) requires PTX version >= 4.0 and sm_30");
1451 O <<
" .attribute(.managed)";
1454 O <<
" .align " <<
A->value();
1456 O <<
" .align " << (int)
DL.getPrefTypeAlign(ETy).value();
1468 O << getPTXFundamentalTypeStr(ETy);
1474 int64_t ElementSize = 0;
1484 ElementSize =
DL.getTypeStoreSize(ETy);
1505 unsigned paramIndex = 0;
1511 if (
F->arg_empty() && !
F->isVarArg()) {
1518 for (
I =
F->arg_begin(), E =
F->arg_end();
I != E; ++
I, paramIndex++) {
1519 Type *Ty =
I->getType();
1531 if (hasImageHandles)
1532 O <<
"\t.param .u64 .ptr .surfref ";
1534 O <<
"\t.param .surfref ";
1535 O << TLI->getParamName(F, paramIndex);
1538 if (hasImageHandles)
1539 O <<
"\t.param .u64 .ptr .texref ";
1541 O <<
"\t.param .texref ";
1542 O << TLI->getParamName(F, paramIndex);
1545 if (hasImageHandles)
1546 O <<
"\t.param .u64 .ptr .samplerref ";
1548 O <<
"\t.param .samplerref ";
1549 O << TLI->getParamName(F, paramIndex);
1555 auto getOptimalAlignForParam = [TLI, &
DL, &PAL,
F,
1559 return StackAlign.
value();
1561 Align TypeAlign = TLI->getFunctionParamOptimizedAlign(F, Ty,
DL);
1562 MaybeAlign ParamAlign = PAL.getParamAlignment(paramIndex);
1563 return std::max(TypeAlign, ParamAlign.
valueOrOne());
1566 if (!PAL.hasParamAttr(paramIndex, Attribute::ByVal)) {
1572 Align OptimalAlign = getOptimalAlignForParam(Ty);
1574 O <<
"\t.param .align " << OptimalAlign.
value() <<
" .b8 ";
1575 O << TLI->getParamName(F, paramIndex);
1576 O <<
"[" <<
DL.getTypeAllocSize(Ty) <<
"]";
1581 auto *PTy = dyn_cast<PointerType>(Ty);
1582 unsigned PTySizeInBits = 0;
1585 TLI->getPointerTy(
DL, PTy->getAddressSpace()).getSizeInBits();
1586 assert(PTySizeInBits &&
"Invalid pointer size");
1592 O <<
"\t.param .u" << PTySizeInBits <<
" ";
1596 int addrSpace = PTy->getAddressSpace();
1597 switch (addrSpace) {
1602 O <<
".ptr .const ";
1605 O <<
".ptr .shared ";
1608 O <<
".ptr .global ";
1611 Align ParamAlign =
I->getParamAlign().valueOrOne();
1612 O <<
".align " << ParamAlign.
value() <<
" ";
1614 O << TLI->getParamName(F, paramIndex);
1624 O << getPTXFundamentalTypeStr(Ty);
1626 O << TLI->getParamName(F, paramIndex);
1632 if (isa<IntegerType>(Ty)) {
1633 sz = cast<IntegerType>(Ty)->getBitWidth();
1636 assert(PTySizeInBits &&
"Invalid pointer size");
1641 O <<
"\t.param .b" << sz <<
" ";
1643 O <<
"\t.reg .b" << sz <<
" ";
1644 O << TLI->getParamName(F, paramIndex);
1649 Type *ETy = PAL.getParamByValType(paramIndex);
1650 assert(ETy &&
"Param should have byval type");
1652 if (isABI || isKernelFunc) {
1657 Align OptimalAlign =
1659 ? getOptimalAlignForParam(ETy)
1660 : TLI->getFunctionByValParamAlign(
1661 F, ETy, PAL.getParamAlignment(paramIndex).valueOrOne(),
DL);
1663 unsigned sz =
DL.getTypeAllocSize(ETy);
1664 O <<
"\t.param .align " << OptimalAlign.
value() <<
" .b8 ";
1665 O << TLI->getParamName(F, paramIndex);
1666 O <<
"[" << sz <<
"]";
1675 for (
unsigned i = 0, e = vtparts.
size(); i != e; ++i) {
1677 EVT elemtype = vtparts[i];
1679 elems = vtparts[i].getVectorNumElements();
1680 elemtype = vtparts[i].getVectorElementType();
1683 for (
unsigned j = 0, je = elems;
j != je; ++
j) {
1687 O <<
"\t.reg .b" << sz <<
" ";
1688 O << TLI->getParamName(F, paramIndex);
1701 if (
F->isVarArg()) {
1706 O << TLI->getParamName(F, -1) <<
"[]";
1712void NVPTXAsmPrinter::setAndEmitFunctionVirtualRegisters(
1729 O <<
"\t.reg .b64 \t%SP;\n";
1730 O <<
"\t.reg .b64 \t%SPL;\n";
1732 O <<
"\t.reg .b32 \t%SP;\n";
1733 O <<
"\t.reg .b32 \t%SPL;\n";
1742 for (
unsigned i = 0; i < numVRs; i++) {
1746 int n = regmap.
size();
1747 regmap.
insert(std::make_pair(vr, n + 1));
1762 for (
unsigned i=0; i<
TRI->getNumRegClasses(); i++) {
1767 int n = regmap.
size();
1771 O <<
"\t.reg " << rcname <<
" \t" << rcStr <<
"<" << (n+1)
1782 unsigned int numHex;
1801 if (
const ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) {
1805 if (
const ConstantFP *CFP = dyn_cast<ConstantFP>(CPV)) {
1806 printFPConstant(CFP, O);
1809 if (isa<ConstantPointerNull>(CPV)) {
1813 if (
const GlobalValue *GVar = dyn_cast<GlobalValue>(CPV)) {
1814 bool IsNonGenericPointer =
false;
1816 IsNonGenericPointer =
true;
1818 if (EmitGeneric && !isa<Function>(CPV) && !IsNonGenericPointer) {
1827 if (
const ConstantExpr *Cexpr = dyn_cast<ConstantExpr>(CPV)) {
1828 const MCExpr *E = lowerConstantForGV(cast<Constant>(Cexpr),
false);
1835void NVPTXAsmPrinter::bufferLEByte(
const Constant *CPV,
int Bytes,
1836 AggBuffer *AggBuffer) {
1838 int AllocSize =
DL.getTypeAllocSize(CPV->
getType());
1842 AggBuffer->addZeros(Bytes ? Bytes : AllocSize);
1847 auto AddIntToBuffer = [AggBuffer, Bytes](
const APInt &Val) {
1848 size_t NumBytes = (Val.getBitWidth() + 7) / 8;
1854 for (
unsigned I = 0;
I < NumBytes - 1; ++
I) {
1855 Buf[
I] = Val.extractBitsAsZExtValue(8,
I * 8);
1857 size_t LastBytePosition = (NumBytes - 1) * 8;
1858 size_t LastByteBits = Val.getBitWidth() - LastBytePosition;
1860 Val.extractBitsAsZExtValue(LastByteBits, LastBytePosition);
1861 AggBuffer->addBytes(Buf.data(), NumBytes, Bytes);
1866 if (
const auto CI = dyn_cast<ConstantInt>(CPV)) {
1870 if (
const auto *Cexpr = dyn_cast<ConstantExpr>(CPV)) {
1871 if (
const auto *CI =
1876 if (Cexpr->getOpcode() == Instruction::PtrToInt) {
1877 Value *
V = Cexpr->getOperand(0)->stripPointerCasts();
1878 AggBuffer->addSymbol(V, Cexpr->getOperand(0));
1879 AggBuffer->addZeros(AllocSize);
1890 AddIntToBuffer(cast<ConstantFP>(CPV)->getValueAPF().bitcastToAPInt());
1894 if (
const GlobalValue *GVar = dyn_cast<GlobalValue>(CPV)) {
1895 AggBuffer->addSymbol(GVar, GVar);
1896 }
else if (
const ConstantExpr *Cexpr = dyn_cast<ConstantExpr>(CPV)) {
1897 const Value *
v = Cexpr->stripPointerCasts();
1898 AggBuffer->addSymbol(v, Cexpr);
1900 AggBuffer->addZeros(AllocSize);
1907 if (isa<ConstantAggregate>(CPV) || isa<ConstantDataSequential>(CPV)) {
1908 bufferAggregateConstant(CPV, AggBuffer);
1909 if (Bytes > AllocSize)
1910 AggBuffer->addZeros(Bytes - AllocSize);
1911 }
else if (isa<ConstantAggregateZero>(CPV))
1912 AggBuffer->addZeros(Bytes);
1923void NVPTXAsmPrinter::bufferAggregateConstant(
const Constant *CPV,
1924 AggBuffer *aggBuffer) {
1929 if (
const ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) {
1931 for (
unsigned I = 0, E =
DL.getTypeAllocSize(CPV->
getType());
I < E; ++
I) {
1933 aggBuffer->addBytes(&Byte, 1, 1);
1940 if (isa<ConstantArray>(CPV) || isa<ConstantVector>(CPV)) {
1943 bufferLEByte(cast<Constant>(CPV->
getOperand(i)), 0, aggBuffer);
1948 dyn_cast<ConstantDataSequential>(CPV)) {
1949 if (CDS->getNumElements())
1950 for (
unsigned i = 0; i < CDS->getNumElements(); ++i)
1951 bufferLEByte(cast<Constant>(CDS->getElementAsConstant(i)), 0,
1956 if (isa<ConstantStruct>(CPV)) {
1961 Bytes =
DL.getStructLayout(ST)->getElementOffset(0) +
1962 DL.getTypeAllocSize(ST) -
1963 DL.getStructLayout(ST)->getElementOffset(i);
1965 Bytes =
DL.getStructLayout(ST)->getElementOffset(i + 1) -
1966 DL.getStructLayout(ST)->getElementOffset(i);
1967 bufferLEByte(cast<Constant>(CPV->
getOperand(i)), Bytes, aggBuffer);
1980NVPTXAsmPrinter::lowerConstantForGV(
const Constant *CV,
bool ProcessingGeneric) {
1986 if (
const ConstantInt *CI = dyn_cast<ConstantInt>(CV))
1989 if (
const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
1992 if (ProcessingGeneric) {
2004 switch (
CE->getOpcode()) {
2008 case Instruction::AddrSpaceCast: {
2011 if (DstTy->getAddressSpace() == 0)
2012 return lowerConstantForGV(cast<const Constant>(
CE->getOperand(0)),
true);
2017 case Instruction::GetElementPtr: {
2021 APInt OffsetAI(
DL.getPointerTypeSizeInBits(
CE->getType()), 0);
2022 cast<GEPOperator>(CE)->accumulateConstantOffset(
DL, OffsetAI);
2024 const MCExpr *
Base = lowerConstantForGV(
CE->getOperand(0),
2029 int64_t
Offset = OffsetAI.getSExtValue();
2034 case Instruction::Trunc:
2040 case Instruction::BitCast:
2041 return lowerConstantForGV(
CE->getOperand(0), ProcessingGeneric);
2043 case Instruction::IntToPtr: {
2052 return lowerConstantForGV(
Op, ProcessingGeneric);
2057 case Instruction::PtrToInt: {
2063 Type *Ty =
CE->getType();
2065 const MCExpr *OpExpr = lowerConstantForGV(
Op, ProcessingGeneric);
2069 if (
DL.getTypeAllocSize(Ty) ==
DL.getTypeAllocSize(
Op->getType()))
2075 unsigned InBits =
DL.getTypeAllocSizeInBits(
Op->getType());
2082 case Instruction::Add: {
2083 const MCExpr *
LHS = lowerConstantForGV(
CE->getOperand(0), ProcessingGeneric);
2084 const MCExpr *
RHS = lowerConstantForGV(
CE->getOperand(1), ProcessingGeneric);
2085 switch (
CE->getOpcode()) {
2097 return lowerConstantForGV(
C, ProcessingGeneric);
2102 OS <<
"Unsupported expression in static initializer: ";
2103 CE->printAsOperand(
OS,
false,
2112 return cast<MCTargetExpr>(&Expr)->printImpl(
OS,
MAI);
2114 OS << cast<MCConstantExpr>(Expr).getValue();
2140 if (isa<MCConstantExpr>(BE.
getLHS()) || isa<MCSymbolRefExpr>(BE.
getLHS()) ||
2141 isa<NVPTXGenericMCSymbolRefExpr>(BE.
getLHS())) {
2153 if (RHSC->getValue() < 0) {
2154 OS << RHSC->getValue();
2165 if (isa<MCConstantExpr>(BE.
getRHS()) || isa<MCSymbolRefExpr>(BE.
getRHS())) {
2181bool NVPTXAsmPrinter::PrintAsmOperand(
const MachineInstr *
MI,
unsigned OpNo,
2183 if (ExtraCode && ExtraCode[0]) {
2184 if (ExtraCode[1] != 0)
2187 switch (ExtraCode[0]) {
2196 printOperand(
MI, OpNo, O);
2201bool NVPTXAsmPrinter::PrintAsmMemoryOperand(
const MachineInstr *
MI,
2203 const char *ExtraCode,
2205 if (ExtraCode && ExtraCode[0])
2209 printMemOperand(
MI, OpNo, O);
2215void NVPTXAsmPrinter::printOperand(
const MachineInstr *
MI,
unsigned OpNum,
2221 if (MO.
getReg() == NVPTX::VRDepot)
2226 emitVirtualRegister(MO.
getReg(), O);
2251void NVPTXAsmPrinter::printMemOperand(
const MachineInstr *
MI,
unsigned OpNum,
2253 printOperand(
MI, OpNum, O);
2255 if (Modifier && strcmp(Modifier,
"add") == 0) {
2257 printOperand(
MI, OpNum + 1, O);
2259 if (
MI->getOperand(OpNum + 1).isImm() &&
2260 MI->getOperand(OpNum + 1).getImm() == 0)
2263 printOperand(
MI, OpNum + 1, O);
static cl::opt< bool > LowerCtorDtor("amdgpu-lower-global-ctor-dtor", cl::desc("Lower GPU ctor / dtors to globals on the device."), cl::init(true), cl::Hidden)
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This file implements a class to represent arbitrary precision integral constant values and operations...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file contains the simple types necessary to represent the attributes associated with functions a...
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_EXTERNAL_VISIBILITY
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Looks at all the uses of the given value Returns the Liveness deduced from the uses of this value Adds all uses that cause the result to be MaybeLive to MaybeLiveRetUses If the result is MaybeLiveUses might be modified but its content should be ignored(since it might not be complete). DeadArgumentEliminationPass
This file defines the DenseMap class.
This file defines the DenseSet and SmallDenseSet classes.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
unsigned const TargetRegisterInfo * TRI
Module.h This file contains the declarations for the Module class.
static bool isEmptyXXStructor(GlobalVariable *GV)
static bool usedInOneFunc(const User *U, Function const *&oneFunc)
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,...
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXAsmPrinter()
static bool usedInGlobalVarDef(const Constant *C)
static bool useFuncSeen(const Constant *C, DenseMap< const Function *, bool > &seenMap)
static 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)
static bool ShouldPassAsArray(Type *Ty)
static void DiscoverDependentGlobals(const Value *V, DenseSet< const GlobalVariable * > &Globals)
DiscoverDependentGlobals - Return a set of GlobalVariables on which V depends.
static bool canDemoteGlobalVar(const GlobalVariable *gv, Function const *&f)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
This file defines the SmallVector class.
opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)
APInt bitcastToAPInt() const
Class for arbitrary precision integers.
APInt getLoBits(unsigned numBits) const
Compute an APInt containing numBits lowbits from this APInt.
uint64_t getZExtValue() const
Get zero extended value.
void lshrInPlace(unsigned ShiftAmt)
Logical right-shift this APInt by ShiftAmt in place.
This class represents an incoming formal argument to a Function.
MCSymbol * getSymbol(const GlobalValue *GV) const
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
TargetMachine & TM
Target machine description.
virtual void PrintSymbolOperand(const MachineOperand &MO, raw_ostream &OS)
Print the MachineOperand as a symbol.
const MCAsmInfo * MAI
Target Asm Printer information.
MachineFunction * MF
The current machine function.
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
unsigned getFunctionNumber() const
Return a unique ID for the current function.
MCSymbol * CurrentFnSym
The symbol for the current function.
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
MCContext & OutContext
This is the context for the output file that we are streaming.
bool doFinalization(Module &M) override
Shut down the asmprinter.
MCSymbol * GetExternalSymbolSymbol(Twine Sym) const
Return the MCSymbol for the specified ExternalSymbol.
virtual void emitBasicBlockStart(const MachineBasicBlock &MBB)
Targets can override this to emit stuff at the start of a basic block.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
const DataLayout & getDataLayout() const
Return information about data layout.
void emitInitialRawDwarfLocDirective(const MachineFunction &MF)
Emits inital debug location directive.
const MCSubtargetInfo & getSubtargetInfo() const
Return information about subtarget.
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
LLVM Basic Block Representation.
const Function * getParent() const
Return the enclosing method, or null if none.
ConstantArray - Constant Array Declarations.
ConstantDataSequential - A vector or array constant whose element type is a simple 1/2/4/8-byte integ...
A constant value that is initialized with an expression using other constant values.
ConstantFP - Floating Point Values [float, double].
const APFloat & getValueAPF() const
This is the shared class of boolean and integer constants.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
const APInt & getValue() const
Return the constant as an APInt value reference.
This is an important base class in LLVM.
bool isNullValue() const
Return true if this is the value that would be returned by getNullValue.
This class represents an Operation in the Expression.
A parsed version of the target data layout string in and methods for querying it.
iterator find(const_arg_type_t< KeyT > Val)
bool contains(const_arg_type_t< KeyT > Val) const
Return true if the specified key is in the map, false otherwise.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Implements a dense probed hash-table based set.
DISubprogram * getSubprogram() const
Get the attached subprogram.
const GlobalObject * getAliaseeObject() const
StringRef getSection() const
Get the custom section of this global if it has one.
MaybeAlign getAlign() const
Returns the alignment of the given variable or function.
bool hasSection() const
Check if this global has a custom object file section.
bool hasLinkOnceLinkage() const
bool hasExternalLinkage() const
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
bool hasLocalLinkage() const
bool hasPrivateLinkage() const
unsigned getAddressSpace() const
Module * getParent()
Get the module that this global value is contained inside of...
PointerType * getType() const
Global values are always pointers.
bool hasWeakLinkage() const
bool hasCommonLinkage() const
bool hasAvailableExternallyLinkage() const
Type * getValueType() const
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
bool hasInitializer() const
Definitions have initializers, declarations don't.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
bool isLoopHeader(const BlockT *BB) const
LoopT * getLoopFor(const BlockT *BB) const
Return the inner most loop that BB lives in.
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
Binary assembler expressions.
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
static const MCBinaryExpr * createAnd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Opcode getOpcode() const
Get the kind of this binary expression.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
@ Unary
Unary expressions.
@ Constant
Constant expressions.
@ SymbolRef
References to labels and assigned expressions.
@ Target
Target specific expression.
@ Binary
Binary expressions.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
Describe properties that are true of each instruction in the target description file.
Instances of this class represent operands of the MCInst class.
static MCOperand createReg(unsigned Reg)
static MCOperand createExpr(const MCExpr *Val)
static MCOperand createImm(int64_t Val)
Represent a reference to a symbol from inside an expression.
const MCSymbol & getSymbol() const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
Unary assembler expressions.
Opcode getOpcode() const
Get the kind of this unary expression.
const MCExpr * getSubExpr() const
Get the child of this unary expression.
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
iterator_range< pred_iterator > predecessors()
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
Align getMaxAlign() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Representation of each machine instruction.
bool hasDebugInfo() const
Returns true if valid debug info is present.
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
MachineBasicBlock * getMBB() const
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
const char * getSymbolName() const
Register getReg() const
getReg - Returns the register number.
const ConstantFP * getFPImm() const
@ MO_Immediate
Immediate operand.
@ MO_GlobalAddress
Address of a global value.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_Register
Register operand.
@ MO_ExternalSymbol
Name of external global symbol.
@ MO_FPImmediate
Floating-point immediate operand.
const TargetRegisterClass * getRegClass(Register Reg) const
Return the register class of the specified virtual register.
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
A Module instance is used to store all the information related to an LLVM module.
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
bool runOnMachineFunction(MachineFunction &F) override
Emit the specified function out to the OutStreamer.
std::string getVirtualRegisterName(unsigned) const
bool doFinalization(Module &M) override
Shut down the asmprinter.
const MCSymbol * getFunctionFrameSymbol() const override
Return symbol for the function pseudo stack if the stack frame is not a register based.
static const NVPTXFloatMCExpr * createConstantBFPHalf(const APFloat &Flt, MCContext &Ctx)
static const NVPTXFloatMCExpr * createConstantFPHalf(const APFloat &Flt, MCContext &Ctx)
static const NVPTXFloatMCExpr * createConstantFPSingle(const APFloat &Flt, MCContext &Ctx)
static const NVPTXFloatMCExpr * createConstantFPDouble(const APFloat &Flt, MCContext &Ctx)
static const NVPTXGenericMCSymbolRefExpr * create(const MCSymbolRefExpr *SymExpr, MCContext &Ctx)
static const char * getRegisterName(MCRegister Reg)
const char * getImageHandleSymbol(unsigned Idx) const
Returns the symbol name at the given index.
const char * getName(unsigned RegNo) const
std::string getTargetName() const
bool hasImageHandles() const
unsigned getMaxRequiredAlignment() const
bool hasMaskOperator() const
const NVPTXTargetLowering * getTargetLowering() const override
unsigned getPTXVersion() const
const NVPTXRegisterInfo * getRegisterInfo() const override
unsigned int getSmVersion() const
NVPTX::DrvInterface getDrvInterface() const
const NVPTXSubtarget * getSubtargetImpl(const Function &) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
UniqueStringSaver & getStrPool() const
Implments NVPTX-specific streamer.
void closeLastSection()
Close last section.
unsigned getAddressSpace() const
Return the address space of the Pointer type.
Wrapper class representing virtual and physical registers.
static Register index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
static constexpr bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Class to represent struct types.
const STC & getSubtarget(const Function &F) const
This method returns a pointer to the specified type of TargetSubtargetInfo.
unsigned getPointerSizeInBits(unsigned AS) const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
bool isVectorTy() const
True if this is an instance of VectorType.
bool isPointerTy() const
True if this is an instance of PointerType.
bool isBFloatTy() const
Return true if this is 'bfloat', a 16-bit bfloat type.
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
@ HalfTyID
16-bit floating point type
@ VoidTyID
type with no size
@ FloatTyID
32-bit floating point type
@ IntegerTyID
Arbitrary bit width integers.
@ FixedVectorTyID
Fixed width SIMD vector type.
@ BFloatTyID
16-bit floating point type (7-bit significand)
@ DoubleTyID
64-bit floating point type
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
bool isAggregateType() const
Return true if the type is an aggregate type.
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool isIntOrPtrTy() const
Return true if this is an integer type or a pointer type.
bool isIntegerTy() const
True if this is an instance of IntegerType.
TypeID getTypeID() const
Return the type id for the type.
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
StringRef save(const char *S)
Value * getOperand(unsigned i) const
unsigned getNumOperands() const
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
StringRef getName() const
Return a constant reference to the value's name.
std::pair< iterator, bool > insert(const ValueT &V)
bool erase(const ValueT &V)
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
A raw_ostream that writes to an SmallVector or SmallString.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
LegalityPredicate isVector(unsigned TypeIdx)
True iff the specified type index is a vector.
@ CE
Windows NT (Windows on ARM)
Reg
All possible values of the reg field in the ModR/M byte.
initializer< Ty > init(const Ty &Val)
uint64_t read64le(const void *P)
uint32_t read32le(const void *P)
This is an optimization pass for GlobalISel generic memory operations.
bool shouldEmitPTXNoReturn(const Value *V, const TargetMachine &TM)
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
std::optional< unsigned > getMaxNTIDy(const Function &F)
std::string getSamplerName(const Value &val)
bool getMinCTASm(const Function &F, unsigned &x)
std::string getNVPTXRegClassName(TargetRegisterClass const *RC)
bool isImage(const Value &val)
std::optional< unsigned > getMaxNTIDz(const Function &F)
MaybeAlign getAlign(const Function &F, unsigned Index)
std::optional< unsigned > getMaxNTIDx(const Function &F)
Constant * ConstantFoldConstant(const Constant *C, const DataLayout &DL, const TargetLibraryInfo *TLI=nullptr)
ConstantFoldConstant - Fold the constant using the specified DataLayout.
bool isManaged(const Value &val)
unsigned promoteScalarArgumentSize(unsigned size)
bool isSurface(const Value &val)
void clearAnnotationCache(const Module *Mod)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
std::string getSurfaceName(const Value &val)
std::optional< unsigned > getReqNTIDy(const Function &F)
FormattedNumber format_hex_no_prefix(uint64_t N, unsigned Width, bool Upper=false)
format_hex_no_prefix - Output N as a fixed width hexadecimal.
bool getMaxNReg(const Function &F, unsigned &x)
bool isTexture(const Value &val)
bool isImageWriteOnly(const Value &val)
bool isImageReadWrite(const Value &val)
void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style, std::optional< size_t > Width=std::nullopt)
std::string getTextureName(const Value &val)
void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< EVT > *MemVTs, SmallVectorImpl< TypeSize > *Offsets=nullptr, TypeSize StartingOffset=TypeSize::getZero())
ComputeValueVTs - Given an LLVM IR type, compute a sequence of EVTs that represent all the individual...
std::string getNVPTXRegClassStr(TargetRegisterClass const *RC)
Target & getTheNVPTXTarget64()
bool isKernelFunction(const Function &F)
std::optional< unsigned > getReqNTIDz(const Function &F)
std::optional< unsigned > getReqNTIDx(const Function &F)
bool isSampler(const Value &val)
Constant * ConstantFoldIntegerCast(Constant *C, Type *DestTy, bool IsSigned, const DataLayout &DL)
Constant fold a zext, sext or trunc, depending on IsSigned and whether the DestTy is wider or narrowe...
bool getMaxClusterRank(const Function &F, unsigned &x)
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...
Target & getTheNVPTXTarget32()
static const fltSemantics & IEEEsingle() LLVM_READNONE
static constexpr roundingMode rmNearestTiesToEven
static const fltSemantics & IEEEdouble() LLVM_READNONE
This struct is a compact representation of a valid (non-zero power of two) alignment.
uint64_t value() const
This is a hole in the type system and should not be abused.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
bool isInteger() const
Return true if this is an integer or a vector integer type.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Align valueOrOne() const
For convenience, returns a valid alignment or 1 if undefined.
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...