25
25
#include " llvm/Analysis/TargetLibraryInfo.h"
26
26
#include " llvm/Analysis/TargetTransformInfo.h"
27
27
#include " llvm/Bitcode/BitcodeWriterPass.h"
28
- #include " llvm/Demangle/Demangle.h"
29
28
#include " llvm/GenXIntrinsics/GenXSPIRVWriterAdaptor.h"
30
29
#include " llvm/IR/Dominators.h"
31
30
#include " llvm/IR/LLVMContext.h"
@@ -229,10 +228,6 @@ cl::opt<bool> EmitExportedSymbols{"emit-exported-symbols",
229
228
cl::desc (" emit exported symbols" ),
230
229
cl::cat (PostLinkCat)};
231
230
232
- cl::opt<bool > EmitImportedSymbols{" emit-imported-symbols" ,
233
- cl::desc (" emit imported symbols" ),
234
- cl::cat (PostLinkCat)};
235
-
236
231
cl::opt<bool > EmitOnlyKernelsAsEntryPoints{
237
232
" emit-only-kernels-as-entry-points" ,
238
233
cl::desc (" Consider only sycl_kernel functions as entry points for "
@@ -255,7 +250,6 @@ struct GlobalBinImageProps {
255
250
bool EmitKernelParamInfo;
256
251
bool EmitProgramMetadata;
257
252
bool EmitExportedSymbols;
258
- bool EmitImportedSymbols;
259
253
bool EmitDeviceGlobalPropSet;
260
254
};
261
255
@@ -417,25 +411,6 @@ std::string saveModuleIR(Module &M, int I, StringRef Suff) {
417
411
return OutFilename;
418
412
}
419
413
420
- bool isImportedFunction (const Function &F) {
421
- if (!F.isDeclaration () || F.isIntrinsic () ||
422
- !llvm::sycl::utils::isSYCLExternalFunction (&F))
423
- return false ;
424
-
425
- // StripDeadPrototypes is called during module splitting
426
- // cleanup. At this point all function decls should have uses.
427
- assert (!F.use_empty () && " Function F has no uses" );
428
-
429
- bool ReturnValue = true ;
430
- if (char *NameStr = itaniumDemangle (F.getName ())) {
431
- StringRef DemangledName (NameStr);
432
- if (DemangledName.starts_with (" __" ))
433
- ReturnValue = false ;
434
- free (NameStr);
435
- }
436
- return ReturnValue;
437
- }
438
-
439
414
std::string saveModuleProperties (module_split::ModuleDesc &MD,
440
415
const GlobalBinImageProps &GlobProps, int I,
441
416
StringRef Suff) {
@@ -499,21 +474,10 @@ std::string saveModuleProperties(module_split::ModuleDesc &MD,
499
474
// so they won't make it into the export list. Should the check be
500
475
// F->getCallingConv() != CallingConv::SPIR_KERNEL?
501
476
if (F->getCallingConv () == CallingConv::SPIR_FUNC) {
502
- PropSet.add (PropSetRegTy::SYCL_EXPORTED_SYMBOLS, F->getName (),
503
- /* PropVal=*/ true );
477
+ PropSet.add (PropSetRegTy::SYCL_EXPORTED_SYMBOLS, F->getName (), true );
504
478
}
505
479
}
506
480
}
507
-
508
- if (GlobProps.EmitImportedSymbols ) {
509
- // record imported functions in the property set
510
- for (const auto &F : M) {
511
- if (isImportedFunction (F))
512
- PropSet.add (PropSetRegTy::SYCL_IMPORTED_SYMBOLS, F.getName (),
513
- /* PropVal=*/ true );
514
- }
515
- }
516
-
517
481
// Metadata names may be composite so we keep them alive until the
518
482
// properties have been written.
519
483
SmallVector<std::string, 4 > MetadataNames;
@@ -766,8 +730,7 @@ IrPropSymFilenameTriple saveModule(module_split::ModuleDesc &MD, int I,
766
730
Res.Ir = saveModuleIR (MD.getModule (), I, Suffix);
767
731
}
768
732
GlobalBinImageProps Props = {EmitKernelParamInfo, EmitProgramMetadata,
769
- EmitExportedSymbols, EmitImportedSymbols,
770
- DeviceGlobals};
733
+ EmitExportedSymbols, DeviceGlobals};
771
734
Res.Prop = saveModuleProperties (MD, Props, I, Suffix);
772
735
773
736
if (DoSymGen) {
@@ -1286,14 +1249,13 @@ int main(int argc, char **argv) {
1286
1249
bool DoParamInfo = EmitKernelParamInfo.getNumOccurrences () > 0 ;
1287
1250
bool DoProgMetadata = EmitProgramMetadata.getNumOccurrences () > 0 ;
1288
1251
bool DoExportedSyms = EmitExportedSymbols.getNumOccurrences () > 0 ;
1289
- bool DoImportedSyms = EmitImportedSymbols.getNumOccurrences () > 0 ;
1290
1252
bool DoDeviceGlobals = DeviceGlobals.getNumOccurrences () > 0 ;
1291
1253
bool DoGenerateDeviceImageWithDefaulValues =
1292
1254
GenerateDeviceImageWithDefaultSpecConsts.getNumOccurrences () > 0 ;
1293
1255
1294
1256
if (!DoSplit && !DoSpecConst && !DoSymGen && !DoParamInfo &&
1295
- !DoProgMetadata && !DoSplitEsimd && !DoExportedSyms && !DoImportedSyms &&
1296
- !DoDeviceGlobals && ! DoLowerEsimd) {
1257
+ !DoProgMetadata && !DoSplitEsimd && !DoExportedSyms && !DoDeviceGlobals &&
1258
+ !DoLowerEsimd) {
1297
1259
errs () << " no actions specified; try --help for usage info\n " ;
1298
1260
return 1 ;
1299
1261
}
@@ -1327,11 +1289,6 @@ int main(int argc, char **argv) {
1327
1289
<< " -" << IROutputOnly.ArgStr << " \n " ;
1328
1290
return 1 ;
1329
1291
}
1330
- if (IROutputOnly && DoImportedSyms) {
1331
- errs () << " error: -" << EmitImportedSymbols.ArgStr << " can't be used with"
1332
- << " -" << IROutputOnly.ArgStr << " \n " ;
1333
- return 1 ;
1334
- }
1335
1292
if (IROutputOnly && DoGenerateDeviceImageWithDefaulValues) {
1336
1293
errs () << " error: -" << GenerateDeviceImageWithDefaultSpecConsts.ArgStr
1337
1294
<< " can't be used with -" << IROutputOnly.ArgStr << " \n " ;
0 commit comments