@@ -204,7 +204,7 @@ struct GlobalBinImageProps {
204
204
bool EmitDeviceGlobalPropSet;
205
205
};
206
206
207
- struct IrPropSymFilenameTripple {
207
+ struct IrPropSymFilenameTriple {
208
208
std::string Ir;
209
209
std::string Prop;
210
210
std::string Sym;
@@ -306,7 +306,7 @@ std::vector<uint32_t> getKernelReqdWorkGroupSizeMetadata(const Function &Func) {
306
306
}
307
307
308
308
// Creates a filename based on current output filename, given extension,
309
- // sequential ID and suffix. If the sequential ID I is negative, it is
309
+ // sequential ID and suffix.
310
310
std::string makeResultFileName (Twine Ext, int I, StringRef Suffix) {
311
311
const StringRef Dir0 = OutputDir.getNumOccurrences () > 0
312
312
? OutputDir
@@ -423,7 +423,7 @@ std::string saveModuleProperties(module_split::ModuleDesc &MD,
423
423
ProgramMetadata.insert ({MetadataNames.back (), KernelReqdWorkGroupSize});
424
424
}
425
425
}
426
- if (MD.Props . HasEsimd == module_split::ESIMDStatus::ESIMD_ONLY ) {
426
+ if (MD.isESIMD () ) {
427
427
PropSet[PropSetRegTy::SYCL_MISC_PROP].insert ({" isEsimdImage" , true });
428
428
}
429
429
{
@@ -442,6 +442,7 @@ std::string saveModuleProperties(module_split::ModuleDesc &MD,
442
442
std::error_code EC;
443
443
std::string SCFile = makeResultFileName (" .prop" , I, Suff);
444
444
raw_fd_ostream SCOut (SCFile, EC);
445
+ checkError (EC, " error opening file '" + SCFile + " '" );
445
446
PropSet.write (SCOut);
446
447
447
448
return SCFile;
@@ -513,17 +514,15 @@ bool lowerEsimdConstructs(module_split::ModuleDesc &MD) {
513
514
}
514
515
515
516
// @param MD Module descriptor to save
516
- // @param IRFilename filename of already avaialble IR component. If not empty,
517
- // IR component saving is skipped, and this file name as recorded as such in
517
+ // @param IRFilename filename of already available IR component. If not empty,
518
+ // IR component saving is skipped, and this file name is recorded as such in
518
519
// the result.
519
520
// @return a triple of files where IR, Property and Symbols components of the
520
521
// Module descriptor are written respectively.
521
- IrPropSymFilenameTripple saveModule (module_split::ModuleDesc &MD, int I,
522
- StringRef IRFilename = " " ) {
523
- IrPropSymFilenameTripple Res;
524
- StringRef Suffix = MD.Props .HasEsimd == module_split::ESIMDStatus::ESIMD_ONLY
525
- ? " _esimd"
526
- : " " ;
522
+ IrPropSymFilenameTriple saveModule (module_split::ModuleDesc &MD, int I,
523
+ StringRef IRFilename = " " ) {
524
+ IrPropSymFilenameTriple Res;
525
+ StringRef Suffix = MD.isESIMD () ? " _esimd" : " " ;
527
526
528
527
if (!IRFilename.empty ()) {
529
528
// don't save IR, just record the filename
@@ -556,7 +555,7 @@ module_split::ModuleDesc link(module_split::ModuleDesc &&MD1,
556
555
module_split::ModuleDesc Res (MD1.releaseModulePtr (), std::move (Names));
557
556
Res.Props .HasEsimd = MD1.Props .HasEsimd == MD2.Props .HasEsimd
558
557
? MD1.Props .HasEsimd
559
- : module_split::ESIMDStatus ::SYCL_AND_ESIMD;
558
+ : module_split::SyclEsimdSplitStatus ::SYCL_AND_ESIMD;
560
559
Res.Props .SpecConstsMet = MD1.Props .SpecConstsMet || MD2.Props .SpecConstsMet ;
561
560
Res.Name = " linked[" + MD1.Name + " ," + MD1.Name + " ]" ;
562
561
return Res;
@@ -603,7 +602,7 @@ bool processCompileTimeProperties(module_split::ModuleDesc &MD) {
603
602
constexpr int MAX_COLUMNS_IN_FILE_TABLE = 3 ;
604
603
605
604
void addTableRow (util::SimpleTable &Table,
606
- const IrPropSymFilenameTripple &RowData) {
605
+ const IrPropSymFilenameTriple &RowData) {
607
606
SmallVector<StringRef, MAX_COLUMNS_IN_FILE_TABLE> Row;
608
607
609
608
for (const std::string *S : {&RowData.Ir , &RowData.Prop , &RowData.Sym }) {
@@ -737,10 +736,8 @@ processInputModule(std::unique_ptr<Module> M) {
737
736
Modified |= processSpecConstants (MDesc1);
738
737
Modified |= processCompileTimeProperties (MDesc1);
739
738
740
- if ((MDesc1.Props .HasEsimd != module_split::ESIMDStatus::SYCL_ONLY) &&
741
- LowerEsimd) {
742
- assert (MDesc1.Props .HasEsimd == module_split::ESIMDStatus::ESIMD_ONLY &&
743
- " NYI" );
739
+ if (!MDesc1.isSYCL () && LowerEsimd) {
740
+ assert (MDesc1.isESIMD () && " NYI" );
744
741
Modified |= lowerEsimdConstructs (MDesc1);
745
742
}
746
743
MMs.emplace_back (std::move (MDesc1));
@@ -779,7 +776,7 @@ processInputModule(std::unique_ptr<Module> M) {
779
776
" have been made\n " ;
780
777
}
781
778
for (module_split::ModuleDesc &IrMD : MMs) {
782
- IrPropSymFilenameTripple T = saveModule (IrMD, ID, OutIRFileName);
779
+ IrPropSymFilenameTriple T = saveModule (IrMD, ID, OutIRFileName);
783
780
addTableRow (*Table, T);
784
781
}
785
782
++ID;
0 commit comments