@@ -1327,25 +1327,24 @@ llvm::Function *CGOpenMPRuntime::emitTaskOutlinedFunction(
1327
1327
1328
1328
void CGOpenMPRuntime::setLocThreadIdInsertPt(CodeGenFunction &CGF,
1329
1329
bool AtCurrentPoint) {
1330
- auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct( CGF.CurFn) ;
1331
- assert(!Elem.second. ServiceInsertPt && "Insert point is set already.");
1330
+ auto &Elem = OpenMPLocThreadIDMap[ CGF.CurFn] ;
1331
+ assert(!Elem.ServiceInsertPt && "Insert point is set already.");
1332
1332
1333
1333
llvm::Value *Undef = llvm::UndefValue::get(CGF.Int32Ty);
1334
1334
if (AtCurrentPoint) {
1335
- Elem.second. ServiceInsertPt = new llvm::BitCastInst(
1336
- Undef, CGF.Int32Ty, "svcpt", CGF.Builder.GetInsertBlock());
1335
+ Elem.ServiceInsertPt = new llvm::BitCastInst(Undef, CGF.Int32Ty, "svcpt",
1336
+ CGF.Builder.GetInsertBlock());
1337
1337
} else {
1338
- Elem.second.ServiceInsertPt =
1339
- new llvm::BitCastInst(Undef, CGF.Int32Ty, "svcpt");
1340
- Elem.second.ServiceInsertPt->insertAfter(CGF.AllocaInsertPt);
1338
+ Elem.ServiceInsertPt = new llvm::BitCastInst(Undef, CGF.Int32Ty, "svcpt");
1339
+ Elem.ServiceInsertPt->insertAfter(CGF.AllocaInsertPt);
1341
1340
}
1342
1341
}
1343
1342
1344
1343
void CGOpenMPRuntime::clearLocThreadIdInsertPt(CodeGenFunction &CGF) {
1345
- auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct( CGF.CurFn) ;
1346
- if (Elem.second. ServiceInsertPt) {
1347
- llvm::Instruction *Ptr = Elem.second. ServiceInsertPt;
1348
- Elem.second. ServiceInsertPt = nullptr;
1344
+ auto &Elem = OpenMPLocThreadIDMap[ CGF.CurFn] ;
1345
+ if (Elem.ServiceInsertPt) {
1346
+ llvm::Instruction *Ptr = Elem.ServiceInsertPt;
1347
+ Elem.ServiceInsertPt = nullptr;
1349
1348
Ptr->eraseFromParent();
1350
1349
}
1351
1350
}
@@ -1441,18 +1440,18 @@ llvm::Value *CGOpenMPRuntime::getThreadID(CodeGenFunction &CGF,
1441
1440
// kmpc_global_thread_num(ident_t *loc).
1442
1441
// Generate thread id value and cache this value for use across the
1443
1442
// function.
1444
- auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct( CGF.CurFn) ;
1445
- if (!Elem.second. ServiceInsertPt)
1443
+ auto &Elem = OpenMPLocThreadIDMap[ CGF.CurFn] ;
1444
+ if (!Elem.ServiceInsertPt)
1446
1445
setLocThreadIdInsertPt(CGF);
1447
1446
CGBuilderTy::InsertPointGuard IPG(CGF.Builder);
1448
- CGF.Builder.SetInsertPoint(Elem.second. ServiceInsertPt);
1447
+ CGF.Builder.SetInsertPoint(Elem.ServiceInsertPt);
1449
1448
auto DL = ApplyDebugLocation::CreateDefaultArtificial(CGF, Loc);
1450
1449
llvm::CallInst *Call = CGF.Builder.CreateCall(
1451
1450
OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(),
1452
1451
OMPRTL___kmpc_global_thread_num),
1453
1452
emitUpdateLocation(CGF, Loc));
1454
1453
Call->setCallingConv(CGF.getRuntimeCC());
1455
- Elem.second. ThreadID = Call;
1454
+ Elem.ThreadID = Call;
1456
1455
return Call;
1457
1456
}
1458
1457
0 commit comments