@@ -408,14 +408,14 @@ static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
408408GenXTargetMachine::GenXTargetMachine (const Target &T, const Triple &TT,
409409 StringRef CPU, StringRef FS,
410410 const TargetOptions &Options,
411- llvm::Optional <Reloc::Model> RM,
412- llvm::Optional <CodeModel::Model> CM,
411+ IGCLLVM::optional <Reloc::Model> RM,
412+ IGCLLVM::optional <CodeModel::Model> CM,
413413 CodeGenOpt::Level OL, bool Is64Bit,
414414 std::unique_ptr<GenXBackendConfig> BC)
415- : IGCLLVM::LLVMTargetMachine(T, getDL(Is64Bit), TT, CPU, FS, Options,
416- RM ? IGCLLVM::makeOptional(RM).value() : Reloc::Model::Static ,
417- CM ? IGCLLVM::makeOptional(CM).value() : CodeModel ::Model::Small ,
418- OL),
415+ : IGCLLVM::LLVMTargetMachine(
416+ T, getDL(Is64Bit), TT, CPU, FS, Options ,
417+ RM ? IGCLLVM::getValue(RM) : Reloc ::Model::Static ,
418+ CM ? IGCLLVM::getValue(CM) : CodeModel::Model::Small, OL),
419419 TLOF(createTLOF(getTargetTriple())), BC(std::move(BC)), Is64Bit(Is64Bit),
420420 Subtarget(TT, CPU.str(), FS.str()) {}
421421
@@ -433,8 +433,8 @@ TargetPassConfig *GenXTargetMachine::createPassConfig(PassManagerBase &PM) {
433433GenXTargetMachine32::GenXTargetMachine32 (const Target &T, const Triple &TT,
434434 StringRef CPU, StringRef FS,
435435 const TargetOptions &Options,
436- llvm::Optional <Reloc::Model> RM,
437- llvm::Optional <CodeModel::Model> CM,
436+ IGCLLVM::optional <Reloc::Model> RM,
437+ IGCLLVM::optional <CodeModel::Model> CM,
438438 CodeGenOpt::Level OL, bool JIT,
439439 std::unique_ptr<GenXBackendConfig> BC)
440440 : GenXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false ,
@@ -443,20 +443,19 @@ GenXTargetMachine32::GenXTargetMachine32(const Target &T, const Triple &TT,
443443GenXTargetMachine64::GenXTargetMachine64 (const Target &T, const Triple &TT,
444444 StringRef CPU, StringRef FS,
445445 const TargetOptions &Options,
446- llvm::Optional <Reloc::Model> RM,
447- llvm::Optional <CodeModel::Model> CM,
446+ IGCLLVM::optional <Reloc::Model> RM,
447+ IGCLLVM::optional <CodeModel::Model> CM,
448448 CodeGenOpt::Level OL, bool JIT,
449449 std::unique_ptr<GenXBackendConfig> BC)
450450 : GenXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true ,
451451 std::move (BC)) {}
452452
453453namespace vc {
454- std::unique_ptr<llvm::TargetMachine>
455- createGenXTargetMachine (const Target &T, Triple TT, StringRef CPU,
456- StringRef Features, const TargetOptions &Options,
457- llvm::Optional<Reloc::Model> RM,
458- llvm::Optional<CodeModel::Model> CM, CodeGenOpt::Level OL,
459- std::unique_ptr<GenXBackendConfig> BC) {
454+ std::unique_ptr<llvm::TargetMachine> createGenXTargetMachine (
455+ const Target &T, Triple TT, StringRef CPU, StringRef Features,
456+ const TargetOptions &Options, IGCLLVM::optional<Reloc::Model> RM,
457+ IGCLLVM::optional<CodeModel::Model> CM, CodeGenOpt::Level OL,
458+ std::unique_ptr<GenXBackendConfig> BC) {
460459 if (is32BitArch (TT))
461460 return std::make_unique<GenXTargetMachine32>(T, TT, CPU, Features, Options,
462461 RM, CM, OL, false /* JIT*/ ,
@@ -1149,7 +1148,8 @@ void GenXTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
11491148 PM.addPass (createModuleToFunctionPassAdaptor (InstCombinePass ()));
11501149
11511150 // Simplify region accesses.
1152- PM.addPass (createModuleToFunctionPassAdaptor (GenXRegionCollapsingPass ()));
1151+ PM.addPass (
1152+ createModuleToFunctionPassAdaptor (GenXRegionCollapsingPass (this )));
11531153 PM.addPass (createModuleToFunctionPassAdaptor (EarlyCSEPass (true )));
11541154 PM.addPass (createModuleToFunctionPassAdaptor (DCEPass ()));
11551155 // }
0 commit comments