@@ -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
}
@@ -558,11 +543,6 @@ bool containsUnsignedAtomicType(StringRef Name) {
558
543
Name[Loc + strlen (kMangledName ::AtomicPrefixIncoming)]);
559
544
}
560
545
561
- Constant *castToVoidFuncPtr (Function *F) {
562
- auto *T = getVoidFuncPtrType (F->getParent ());
563
- return ConstantExpr::getBitCast (F, T);
564
- }
565
-
566
546
bool hasArrayArg (Function *F) {
567
547
for (auto I = F->arg_begin (), E = F->arg_end (); I != E; ++I) {
568
548
LLVM_DEBUG (dbgs () << " [hasArrayArg] " << *I << ' \n ' );
@@ -1028,10 +1008,6 @@ void makeVector(Instruction *InsPos, std::vector<Value *> &Ops,
1028
1008
Ops.push_back (Vec);
1029
1009
}
1030
1010
1031
- Constant *castToInt8Ptr (Constant *V, unsigned Addr = 0 ) {
1032
- return ConstantExpr::getBitCast (V, PointerType::get (V->getContext (), Addr));
1033
- }
1034
-
1035
1011
PointerType *getInt8PtrTy (PointerType *T) {
1036
1012
return PointerType::get (T->getContext (), T->getAddressSpace ());
1037
1013
}
@@ -1159,15 +1135,6 @@ std::tuple<unsigned, unsigned, std::string> getSPIRVSource(Module *M) {
1159
1135
return Tup;
1160
1136
}
1161
1137
1162
- ConstantInt *mapUInt (Module *M, ConstantInt *I,
1163
- std::function<unsigned (unsigned )> F) {
1164
- return ConstantInt::get (I->getIntegerType (), F (I->getZExtValue ()), false );
1165
- }
1166
-
1167
- ConstantInt *mapSInt (Module *M, ConstantInt *I, std::function<int (int )> F) {
1168
- return ConstantInt::get (I->getIntegerType (), F (I->getSExtValue ()), true );
1169
- }
1170
-
1171
1138
bool isDecoratedSPIRVFunc (const Function *F, StringRef &UndecoratedName) {
1172
1139
if (!F->hasName () || !F->getName ().starts_with (kSPIRVName ::Prefix))
1173
1140
return false ;
0 commit comments