@@ -309,21 +309,6 @@ Scope getArgAsScope(CallInst *CI, unsigned I) {
309
309
return static_cast <Scope>(getArgAsInt (CI, I));
310
310
}
311
311
312
- Decoration getArgAsDecoration (CallInst *CI, unsigned I) {
313
- return static_cast <Decoration>(getArgAsInt (CI, I));
314
- }
315
-
316
- std::string decorateSPIRVFunction (const std::string &S) {
317
- return std::string (kSPIRVName ::Prefix) + S + kSPIRVName ::Postfix;
318
- }
319
-
320
- StringRef undecorateSPIRVFunction (StringRef S) {
321
- assert (S.find (kSPIRVName ::Prefix) == 0 );
322
- const size_t Start = strlen (kSPIRVName ::Prefix);
323
- auto End = S.rfind (kSPIRVName ::Postfix);
324
- return S.substr (Start, End - Start);
325
- }
326
-
327
312
std::string prefixSPIRVName (const std::string &S) {
328
313
return std::string (kSPIRVName ::Prefix) + S;
329
314
}
@@ -560,11 +545,6 @@ bool containsUnsignedAtomicType(StringRef Name) {
560
545
Name[Loc + strlen (kMangledName ::AtomicPrefixIncoming)]);
561
546
}
562
547
563
- Constant *castToVoidFuncPtr (Function *F) {
564
- auto *T = getVoidFuncPtrType (F->getParent ());
565
- return ConstantExpr::getBitCast (F, T);
566
- }
567
-
568
548
bool hasArrayArg (Function *F) {
569
549
for (auto I = F->arg_begin (), E = F->arg_end (); I != E; ++I) {
570
550
LLVM_DEBUG (dbgs () << " [hasArrayArg] " << *I << ' \n ' );
@@ -1030,10 +1010,6 @@ void makeVector(Instruction *InsPos, std::vector<Value *> &Ops,
1030
1010
Ops.push_back (Vec);
1031
1011
}
1032
1012
1033
- Constant *castToInt8Ptr (Constant *V, unsigned Addr = 0 ) {
1034
- return ConstantExpr::getBitCast (V, PointerType::get (V->getContext (), Addr));
1035
- }
1036
-
1037
1013
PointerType *getInt8PtrTy (PointerType *T) {
1038
1014
return PointerType::get (T->getContext (), T->getAddressSpace ());
1039
1015
}
@@ -1161,15 +1137,6 @@ std::tuple<unsigned, unsigned, std::string> getSPIRVSource(Module *M) {
1161
1137
return Tup;
1162
1138
}
1163
1139
1164
- ConstantInt *mapUInt (Module *M, ConstantInt *I,
1165
- std::function<unsigned (unsigned )> F) {
1166
- return ConstantInt::get (I->getIntegerType (), F (I->getZExtValue ()), false );
1167
- }
1168
-
1169
- ConstantInt *mapSInt (Module *M, ConstantInt *I, std::function<int (int )> F) {
1170
- return ConstantInt::get (I->getIntegerType (), F (I->getSExtValue ()), true );
1171
- }
1172
-
1173
1140
bool isDecoratedSPIRVFunc (const Function *F, StringRef &UndecoratedName) {
1174
1141
if (!F->hasName () || !F->getName ().starts_with (kSPIRVName ::Prefix))
1175
1142
return false ;
0 commit comments