@@ -145,8 +145,6 @@ static bool isValidWorkshareLoopScheduleType(OMPScheduleType SchedType) {
145
145
}
146
146
#endif
147
147
148
- Function *GLOBAL_ReductionFunc = nullptr ;
149
-
150
148
static const omp::GV &getGridValue (const Triple &T, Function *Kernel) {
151
149
if (T.isAMDGPU ()) {
152
150
StringRef Features =
@@ -795,7 +793,7 @@ void OpenMPIRBuilder::finalize(Function *Fn) {
795
793
if (!OffloadInfoManager.empty ())
796
794
createOffloadEntriesAndInfoMetadata (ErrorReportFn);
797
795
798
- if (Config.EmitLLVMUsed ) {
796
+ if (Config.EmitLLVMUsedMetaInfo . value_or ( false ) ) {
799
797
std::vector<WeakTrackingVH> LLVMCompilerUsed = {
800
798
M.getGlobalVariable (" __openmp_nvptx_data_transfer_temporary_storage" )};
801
799
emitUsed (" llvm.compiler.used" , LLVMCompilerUsed);
@@ -3338,15 +3336,11 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createReductionsGPU(
3338
3336
FuncAttrs = FuncAttrs.addFnAttributes (Ctx, AttrBldr);
3339
3337
3340
3338
Function *ReductionFunc = nullptr ;
3341
- if (GLOBAL_ReductionFunc) {
3342
- ReductionFunc = GLOBAL_ReductionFunc;
3343
- } else {
3344
- CodeGenIP = Builder.saveIP ();
3345
- ReductionFunc = createReductionFunction (
3346
- Builder.GetInsertBlock ()->getParent ()->getName (), ReductionInfos,
3347
- ReductionGenCBKind, FuncAttrs);
3348
- Builder.restoreIP (CodeGenIP);
3349
- }
3339
+ CodeGenIP = Builder.saveIP ();
3340
+ ReductionFunc =
3341
+ createReductionFunction (Builder.GetInsertBlock ()->getParent ()->getName (),
3342
+ ReductionInfos, ReductionGenCBKind, FuncAttrs);
3343
+ Builder.restoreIP (CodeGenIP);
3350
3344
3351
3345
// Set the grid value in the config needed for lowering later on
3352
3346
if (GridValue.has_value ())
0 commit comments