@@ -918,26 +918,6 @@ void getParameterTypes(Function *F, SmallVectorImpl<TypedPointerType *> &ArgTys,
918918 }
919919}
920920
921- static Type *toTypedPointerType (Type *T) {
922- if (!isa<PointerType>(T))
923- return T;
924- return TypedPointerType::get (
925- toTypedPointerType (T->getNonOpaquePointerElementType ()),
926- T->getPointerAddressSpace ());
927- }
928-
929- // This is a transitional helper function to fill in mangling information for
930- // mangleBuiltin while all the calls to mutateCallInst are being transitioned.
931- static void typeMangle (BuiltinFuncMangleInfo *Mangle, ArrayRef<Value *> Args) {
932- if (!Mangle)
933- return ;
934- for (unsigned I = 0 ; I < Args.size (); I++)
935- if (Args[I]->getType ()->isPointerTy ()) {
936- Mangle->getTypeMangleInfo (I).PointerTy =
937- toTypedPointerType (Args[I]->getType ());
938- }
939- }
940-
941921CallInst *mutateCallInst (
942922 Module *M, CallInst *CI,
943923 std::function<std::string(CallInst *, std::vector<Value *> &)> ArgMutate,
@@ -951,7 +931,6 @@ CallInst *mutateCallInst(
951931 InstName = CI->getName ().str ();
952932 CI->setName (InstName + " .old" );
953933 }
954- typeMangle (Mangle, Args);
955934 auto NewCI = addCallInst (M, NewName, CI->getType (), Args, Attrs, CI, Mangle,
956935 InstName, TakeFuncName);
957936 NewCI->setDebugLoc (CI->getDebugLoc ());
@@ -973,7 +952,6 @@ Instruction *mutateCallInst(
973952 Type *RetTy = CI->getType ();
974953 auto NewName = ArgMutate (CI, Args, RetTy);
975954 StringRef InstName = CI->getName ();
976- typeMangle (Mangle, Args);
977955 auto NewCI = addCallInst (M, NewName, RetTy, Args, Attrs, CI, Mangle, InstName,
978956 TakeFuncName);
979957 auto NewI = RetMutate (NewCI);
@@ -1014,23 +992,6 @@ void mutateFunction(
1014992 F->eraseFromParent ();
1015993}
1016994
1017- CallInst *mutateCallInstSPIRV (
1018- Module *M, CallInst *CI,
1019- std::function<std::string(CallInst *, std::vector<Value *> &)> ArgMutate,
1020- AttributeList *Attrs) {
1021- BuiltinFuncMangleInfo BtnInfo;
1022- return mutateCallInst (M, CI, ArgMutate, &BtnInfo, Attrs);
1023- }
1024-
1025- Instruction *mutateCallInstSPIRV (
1026- Module *M, CallInst *CI,
1027- std::function<std::string(CallInst *, std::vector<Value *> &, Type *&RetTy)>
1028- ArgMutate,
1029- std::function<Instruction *(CallInst *)> RetMutate, AttributeList *Attrs) {
1030- BuiltinFuncMangleInfo BtnInfo;
1031- return mutateCallInst (M, CI, ArgMutate, RetMutate, &BtnInfo, Attrs);
1032- }
1033-
1034995CallInst *addCallInst (Module *M, StringRef FuncName, Type *RetTy,
1035996 ArrayRef<Value *> Args, AttributeList *Attrs,
1036997 Instruction *Pos, BuiltinFuncMangleInfo *Mangle,
@@ -1087,22 +1048,6 @@ void makeVector(Instruction *InsPos, std::vector<Value *> &Ops,
10871048 Ops.push_back (Vec);
10881049}
10891050
1090- void expandVector (Instruction *InsPos, std::vector<Value *> &Ops,
1091- size_t VecPos) {
1092- auto Vec = Ops[VecPos];
1093- auto *VT = dyn_cast<FixedVectorType>(Vec->getType ());
1094- if (!VT)
1095- return ;
1096- size_t N = VT->getNumElements ();
1097- IRBuilder<> Builder (InsPos);
1098- for (size_t I = 0 ; I != N; ++I)
1099- Ops.insert (Ops.begin () + VecPos + I,
1100- Builder.CreateExtractElement (
1101- Vec, ConstantInt::get (Type::getInt32Ty (InsPos->getContext ()),
1102- I, false )));
1103- Ops.erase (Ops.begin () + VecPos + N);
1104- }
1105-
11061051Constant *castToInt8Ptr (Constant *V, unsigned Addr = 0 ) {
11071052 return ConstantExpr::getBitCast (V, Type::getInt8PtrTy (V->getContext (), Addr));
11081053}
@@ -1586,13 +1531,6 @@ bool isSPIRVConstantName(StringRef TyName) {
15861531 return false ;
15871532}
15881533
1589- Type *getSPIRVTypeByChangeBaseTypeName (Module *M, Type *T, StringRef OldName,
1590- StringRef NewName) {
1591- return PointerType::get (
1592- getSPIRVStructTypeByChangeBaseTypeName (M, T, OldName, NewName),
1593- SPIRAS_Global);
1594- }
1595-
15961534Type *getSPIRVStructTypeByChangeBaseTypeName (Module *M, Type *T,
15971535 StringRef OldName,
15981536 StringRef NewName) {
0 commit comments