@@ -36,8 +36,6 @@ using namespace llvm;
3636using namespace llvm ::object;
3737using namespace llvm ::offloading;
3838
39- using OffloadingImage = OffloadBinary::OffloadingImage;
40-
4139namespace {
4240// / Magic number that begins the section containing the CUDA fatbinary.
4341constexpr unsigned CudaFatMagic = 0x466243b1 ;
@@ -834,29 +832,6 @@ struct SYCLWrapper {
834832 return std::make_pair (EntriesB, EntriesE);
835833 }
836834
837- // / Emits a global array that contains \p Address and \P Size. Also add
838- // / it into llvm.used to force it to be emitted in the object file.
839- void emitRegistrationFunctions (Constant *Address, size_t Size,
840- const Twine &ImageID,
841- StringRef OffloadKindTag) {
842- Type *IntPtrTy = M.getDataLayout ().getIntPtrType (C);
843- auto *ImgInfoArr =
844- ConstantArray::get (ArrayType::get (IntPtrTy, 2 ),
845- {ConstantExpr::getPointerCast (Address, IntPtrTy),
846- ConstantInt::get (IntPtrTy, Size)});
847- auto *ImgInfoVar = new GlobalVariable (
848- M, ImgInfoArr->getType (), true , GlobalVariable::InternalLinkage,
849- ImgInfoArr, Twine (OffloadKindTag) + ImageID + " .info" );
850- ImgInfoVar->setAlignment (
851- MaybeAlign (M.getDataLayout ().getTypeStoreSize (IntPtrTy) * 2u ));
852- ImgInfoVar->setUnnamedAddr (GlobalValue::UnnamedAddr::Local);
853- ImgInfoVar->setSection (" .tgtimg" );
854-
855- // Add image info to the used list to force it to be emitted to the
856- // object.
857- appendToUsed (M, ImgInfoVar);
858- }
859-
860835 Constant *wrapImage (const OffloadBinary &OB, const Twine &ImageID,
861836 StringRef OffloadKindTag) {
862837 // Note: Intel DPC++ compiler had 2 versions of this structure
@@ -897,9 +872,6 @@ struct SYCLWrapper {
897872 Binary.second , ImageEntriesPtrs.first , ImageEntriesPtrs.second ,
898873 PropertiesConstants.first , PropertiesConstants.second );
899874
900- emitRegistrationFunctions (Binary.first , RawImage.size (), ImageID,
901- OffloadKindTag);
902-
903875 return WrappedBinary;
904876 }
905877
0 commit comments