Lines Matching defs:TLI

254                                          const TargetLibraryInfo &TLI) {
258 return inferNonMandatoryLibFuncAttrs(*F, TLI);
262 const TargetLibraryInfo &TLI) {
264 if (!(TLI.getLibFunc(F, TheLibFunc) && TLI.has(TheLibFunc)))
1252 const TargetLibraryInfo &TLI, bool Signed = true) {
1253 Attribute::AttrKind ExtAttr = TLI.getExtAttrForI32Param(Signed);
1259 const TargetLibraryInfo &TLI, bool Signed = true) {
1260 Attribute::AttrKind ExtAttr = TLI.getExtAttrForI32Return(Signed);
1300 FunctionCallee llvm::getOrInsertLibFunc(Module *M, const TargetLibraryInfo &TLI,
1303 assert(TLI.has(TheLibFunc) &&
1305 StringRef Name = TLI.getName(TheLibFunc);
1322 setArgExtAttr(*F, 0, TLI);
1330 setArgExtAttr(*F, 1, TLI);
1333 setArgExtAttr(*F, 2, TLI);
1340 setRetExtAttr(*F, TLI);
1373 FunctionCallee llvm::getOrInsertLibFunc(Module *M, const TargetLibraryInfo &TLI,
1375 return getOrInsertLibFunc(M, TLI, TheLibFunc, T, AttributeList());
1378 bool llvm::isLibFuncEmittable(const Module *M, const TargetLibraryInfo *TLI,
1380 StringRef FuncName = TLI->getName(TheLibFunc);
1381 if (!TLI->has(TheLibFunc))
1388 return TLI->isValidProtoForLibFunc(*F->getFunctionType(), TheLibFunc, *M);
1395 bool llvm::isLibFuncEmittable(const Module *M, const TargetLibraryInfo *TLI,
1398 return TLI->getLibFunc(Name, TheLibFunc) &&
1399 isLibFuncEmittable(M, TLI, TheLibFunc);
1402 bool llvm::hasFloatFn(const Module *M, const TargetLibraryInfo *TLI, Type *Ty,
1408 return isLibFuncEmittable(M, TLI, FloatFn);
1410 return isLibFuncEmittable(M, TLI, DoubleFn);
1412 return isLibFuncEmittable(M, TLI, LongDoubleFn);
1416 StringRef llvm::getFloatFn(const Module *M, const TargetLibraryInfo *TLI,
1419 assert(hasFloatFn(M, TLI, Ty, DoubleFn, FloatFn, LongDoubleFn) &&
1427 return TLI->getName(FloatFn);
1430 return TLI->getName(DoubleFn);
1433 return TLI->getName(LongDoubleFn);
1439 static IntegerType *getIntTy(IRBuilderBase &B, const TargetLibraryInfo *TLI) {
1440 return B.getIntNTy(TLI->getIntSize());
1443 static IntegerType *getSizeTTy(IRBuilderBase &B, const TargetLibraryInfo *TLI) {
1445 return B.getIntNTy(TLI->getSizeTSize(*M));
1451 const TargetLibraryInfo *TLI,
1454 if (!isLibFuncEmittable(M, TLI, TheLibFunc))
1457 StringRef FuncName = TLI->getName(TheLibFunc);
1459 FunctionCallee Callee = getOrInsertLibFunc(M, *TLI, TheLibFunc, FuncType);
1460 inferNonMandatoryLibFuncAttrs(M, FuncName, *TLI);
1469 const TargetLibraryInfo *TLI) {
1471 Type *SizeTTy = getSizeTTy(B, TLI);
1472 return emitLibCall(LibFunc_strlen, SizeTTy, CharPtrTy, Ptr, B, TLI);
1476 const TargetLibraryInfo *TLI) {
1478 return emitLibCall(LibFunc_strdup, CharPtrTy, CharPtrTy, Ptr, B, TLI);
1482 const TargetLibraryInfo *TLI) {
1484 Type *IntTy = getIntTy(B, TLI);
1486 {Ptr, ConstantInt::get(IntTy, C)}, B, TLI);
1490 const DataLayout &DL, const TargetLibraryInfo *TLI) {
1492 Type *IntTy = getIntTy(B, TLI);
1493 Type *SizeTTy = getSizeTTy(B, TLI);
1497 {Ptr1, Ptr2, Len}, B, TLI);
1501 const TargetLibraryInfo *TLI) {
1504 {Dst, Src}, B, TLI);
1508 const TargetLibraryInfo *TLI) {
1511 {Dst, Src}, B, TLI);
1515 const TargetLibraryInfo *TLI) {
1517 Type *SizeTTy = getSizeTTy(B, TLI);
1519 {Dst, Src, Len}, B, TLI);
1523 const TargetLibraryInfo *TLI) {
1525 Type *SizeTTy = getSizeTTy(B, TLI);
1527 {Dst, Src, Len}, B, TLI);
1532 const TargetLibraryInfo *TLI) {
1534 if (!isLibFuncEmittable(M, TLI, LibFunc_memcpy_chk))
1541 Type *SizeTTy = getSizeTTy(B, TLI);
1542 FunctionCallee MemCpy = getOrInsertLibFunc(M, *TLI, LibFunc_memcpy_chk,
1553 const DataLayout &DL, const TargetLibraryInfo *TLI) {
1555 Type *SizeTTy = getSizeTTy(B, TLI);
1558 {Dst, Src, Len}, B, TLI);
1562 const DataLayout &DL, const TargetLibraryInfo *TLI) {
1564 Type *IntTy = getIntTy(B, TLI);
1565 Type *SizeTTy = getSizeTTy(B, TLI);
1568 {Ptr, Val, Len}, B, TLI);
1572 const DataLayout &DL, const TargetLibraryInfo *TLI) {
1574 Type *IntTy = getIntTy(B, TLI);
1575 Type *SizeTTy = getSizeTTy(B, TLI);
1578 {Ptr, Val, Len}, B, TLI);
1582 const DataLayout &DL, const TargetLibraryInfo *TLI) {
1584 Type *IntTy = getIntTy(B, TLI);
1585 Type *SizeTTy = getSizeTTy(B, TLI);
1588 {Ptr1, Ptr2, Len}, B, TLI);
1592 const DataLayout &DL, const TargetLibraryInfo *TLI) {
1594 Type *IntTy = getIntTy(B, TLI);
1595 Type *SizeTTy = getSizeTTy(B, TLI);
1598 {Ptr1, Ptr2, Len}, B, TLI);
1602 IRBuilderBase &B, const TargetLibraryInfo *TLI) {
1604 Type *IntTy = getIntTy(B, TLI);
1605 Type *SizeTTy = getSizeTTy(B, TLI);
1608 {Ptr1, Ptr2, Val, Len}, B, TLI);
1613 const TargetLibraryInfo *TLI) {
1615 Type *IntTy = getIntTy(B, TLI);
1616 Type *SizeTTy = getSizeTTy(B, TLI);
1621 Args, B, TLI, /*IsVaArgs=*/true);
1626 const TargetLibraryInfo *TLI) {
1628 Type *IntTy = getIntTy(B, TLI);
1632 {CharPtrTy, CharPtrTy}, Args, B, TLI,
1637 const TargetLibraryInfo *TLI) {
1641 {Dest, Src}, B, TLI);
1645 const TargetLibraryInfo *TLI) {
1647 Type *SizeTTy = getSizeTTy(B, TLI);
1650 {Dest, Src, Size}, B, TLI);
1654 const TargetLibraryInfo *TLI) {
1656 Type *SizeTTy = getSizeTTy(B, TLI);
1659 {Dest, Src, Size}, B, TLI);
1663 const TargetLibraryInfo *TLI) {
1665 Type *SizeTTy = getSizeTTy(B, TLI);
1668 {Dest, Src, Size}, B, TLI);
1672 IRBuilderBase &B, const TargetLibraryInfo *TLI) {
1674 Type *IntTy = getIntTy(B, TLI);
1675 Type *SizeTTy = getSizeTTy(B, TLI);
1679 {Dest, Size, Fmt, VAList}, B, TLI);
1683 IRBuilderBase &B, const TargetLibraryInfo *TLI) {
1685 Type *IntTy = getIntTy(B, TLI);
1688 {Dest, Fmt, VAList}, B, TLI);
1709 const TargetLibraryInfo *TLI) {
1713 FunctionCallee Callee = getOrInsertLibFunc(M, *TLI, TheLibFunc, Op->getType(),
1729 Value *llvm::emitUnaryFloatFnCall(Value *Op, const TargetLibraryInfo *TLI,
1736 TLI->getLibFunc(Name, TheLibFunc);
1738 return emitUnaryFloatFnCallHelper(Op, TheLibFunc, Name, B, Attrs, TLI);
1741 Value *llvm::emitUnaryFloatFnCall(Value *Op, const TargetLibraryInfo *TLI,
1745 // Get the name of the function according to TLI.
1748 StringRef Name = getFloatFn(M, TLI, Op->getType(), DoubleFn, FloatFn,
1751 return emitUnaryFloatFnCallHelper(Op, TheLibFunc, Name, B, Attrs, TLI);
1758 const TargetLibraryInfo *TLI) {
1762 FunctionCallee Callee = getOrInsertLibFunc(M, *TLI, TheLibFunc, Op1->getType(),
1764 inferNonMandatoryLibFuncAttrs(M, Name, *TLI);
1780 const TargetLibraryInfo *TLI,
1789 TLI->getLibFunc(Name, TheLibFunc);
1791 return emitBinaryFloatFnCallHelper(Op1, Op2, TheLibFunc, Name, B, Attrs, TLI);
1795 const TargetLibraryInfo *TLI,
1799 // Get the name of the function according to TLI.
1802 StringRef Name = getFloatFn(M, TLI, Op1->getType(), DoubleFn, FloatFn,
1805 return emitBinaryFloatFnCallHelper(Op1, Op2, TheLibFunc, Name, B, Attrs, TLI);
1811 const TargetLibraryInfo *TLI) {
1813 if (!isLibFuncEmittable(M, TLI, LibFunc_putchar))
1816 Type *IntTy = getIntTy(B, TLI);
1817 StringRef PutCharName = TLI->getName(LibFunc_putchar);
1818 FunctionCallee PutChar = getOrInsertLibFunc(M, *TLI, LibFunc_putchar,
1820 inferNonMandatoryLibFuncAttrs(M, PutCharName, *TLI);
1830 const TargetLibraryInfo *TLI) {
1832 if (!isLibFuncEmittable(M, TLI, LibFunc_puts))
1835 Type *IntTy = getIntTy(B, TLI);
1836 StringRef PutsName = TLI->getName(LibFunc_puts);
1837 FunctionCallee PutS = getOrInsertLibFunc(M, *TLI, LibFunc_puts, IntTy,
1839 inferNonMandatoryLibFuncAttrs(M, PutsName, *TLI);
1848 const TargetLibraryInfo *TLI) {
1850 if (!isLibFuncEmittable(M, TLI, LibFunc_fputc))
1853 Type *IntTy = getIntTy(B, TLI);
1854 StringRef FPutcName = TLI->getName(LibFunc_fputc);
1855 FunctionCallee F = getOrInsertLibFunc(M, *TLI, LibFunc_fputc, IntTy,
1858 inferNonMandatoryLibFuncAttrs(M, FPutcName, *TLI);
1868 const TargetLibraryInfo *TLI) {
1870 if (!isLibFuncEmittable(M, TLI, LibFunc_fputs))
1873 Type *IntTy = getIntTy(B, TLI);
1874 StringRef FPutsName = TLI->getName(LibFunc_fputs);
1875 FunctionCallee F = getOrInsertLibFunc(M, *TLI, LibFunc_fputs, IntTy,
1878 inferNonMandatoryLibFuncAttrs(M, FPutsName, *TLI);
1888 const DataLayout &DL, const TargetLibraryInfo *TLI) {
1890 if (!isLibFuncEmittable(M, TLI, LibFunc_fwrite))
1893 Type *SizeTTy = getSizeTTy(B, TLI);
1894 StringRef FWriteName = TLI->getName(LibFunc_fwrite);
1895 FunctionCallee F = getOrInsertLibFunc(M, *TLI, LibFunc_fwrite,
1900 inferNonMandatoryLibFuncAttrs(M, FWriteName, *TLI);
1912 const TargetLibraryInfo *TLI) {
1914 if (!isLibFuncEmittable(M, TLI, LibFunc_malloc))
1917 StringRef MallocName = TLI->getName(LibFunc_malloc);
1918 Type *SizeTTy = getSizeTTy(B, TLI);
1919 FunctionCallee Malloc = getOrInsertLibFunc(M, *TLI, LibFunc_malloc,
1921 inferNonMandatoryLibFuncAttrs(M, MallocName, *TLI);
1932 const TargetLibraryInfo &TLI) {
1934 if (!isLibFuncEmittable(M, &TLI, LibFunc_calloc))
1937 StringRef CallocName = TLI.getName(LibFunc_calloc);
1938 Type *SizeTTy = getSizeTTy(B, &TLI);
1939 FunctionCallee Calloc = getOrInsertLibFunc(M, TLI, LibFunc_calloc,
1941 inferNonMandatoryLibFuncAttrs(M, CallocName, TLI);
1952 const TargetLibraryInfo *TLI, LibFunc NewFunc,
1955 if (!isLibFuncEmittable(M, TLI, NewFunc))
1958 StringRef Name = TLI->getName(NewFunc);
1961 inferNonMandatoryLibFuncAttrs(M, Name, *TLI);
1972 const TargetLibraryInfo *TLI,
1975 if (!isLibFuncEmittable(M, TLI, NewFunc))
1978 StringRef Name = TLI->getName(NewFunc);
1982 inferNonMandatoryLibFuncAttrs(M, Name, *TLI);
1993 const TargetLibraryInfo *TLI,
1996 if (!isLibFuncEmittable(M, TLI, NewFunc))
1999 StringRef Name = TLI->getName(NewFunc);
2002 inferNonMandatoryLibFuncAttrs(M, Name, *TLI);
2014 const TargetLibraryInfo *TLI,
2017 if (!isLibFuncEmittable(M, TLI, NewFunc))
2020 StringRef Name = TLI->getName(NewFunc);
2024 inferNonMandatoryLibFuncAttrs(M, Name, *TLI);