@@ -264,8 +264,7 @@ convertOmpParallel(omp::ParallelOp opInst, llvm::IRBuilderBase &builder,
264
264
builder.CreateBr (entryBB);
265
265
builder.SetInsertPoint (entryBB);
266
266
}
267
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (
268
- builder.saveIP (), builder.getCurrentDebugLocation ());
267
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
269
268
builder.restoreIP (moduleTranslation.getOpenMPBuilder ()->createParallel (
270
269
ompLoc, findAllocaInsertPoint (builder, moduleTranslation), bodyGenCB,
271
270
privCB, finiCB, ifCond, numThreads, pbKind, isCancellable));
@@ -295,8 +294,7 @@ convertOmpMaster(Operation &opInst, llvm::IRBuilderBase &builder,
295
294
// called for variables which have destructors/finalizers.
296
295
auto finiCB = [&](InsertPointTy codeGenIP) {};
297
296
298
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (
299
- builder.saveIP (), builder.getCurrentDebugLocation ());
297
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
300
298
builder.restoreIP (moduleTranslation.getOpenMPBuilder ()->createMaster (
301
299
ompLoc, bodyGenCB, finiCB));
302
300
return success ();
@@ -325,8 +323,7 @@ convertOmpCritical(Operation &opInst, llvm::IRBuilderBase &builder,
325
323
// called for variables which have destructors/finalizers.
326
324
auto finiCB = [&](InsertPointTy codeGenIP) {};
327
325
328
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (
329
- builder.saveIP (), builder.getCurrentDebugLocation ());
326
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
330
327
llvm::LLVMContext &llvmContext = moduleTranslation.getLLVMContext ();
331
328
llvm::Constant *hint = nullptr ;
332
329
@@ -520,8 +517,7 @@ convertOmpOrdered(Operation &opInst, llvm::IRBuilderBase &builder,
520
517
SmallVector<llvm::Value *> vecValues =
521
518
moduleTranslation.lookupValues (orderedOp.depend_vec_vars ());
522
519
523
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (
524
- builder.saveIP (), builder.getCurrentDebugLocation ());
520
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
525
521
size_t indexVecValues = 0 ;
526
522
while (indexVecValues < vecValues.size ()) {
527
523
SmallVector<llvm::Value *> storeValues;
@@ -566,8 +562,7 @@ convertOmpOrderedRegion(Operation &opInst, llvm::IRBuilderBase &builder,
566
562
// called for variables which have destructors/finalizers.
567
563
auto finiCB = [&](InsertPointTy codeGenIP) {};
568
564
569
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (
570
- builder.saveIP (), builder.getCurrentDebugLocation ());
565
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
571
566
builder.restoreIP (
572
567
moduleTranslation.getOpenMPBuilder ()->createOrderedThreadsSimd (
573
568
ompLoc, bodyGenCB, finiCB, !orderedRegionOp.simd ()));
@@ -637,8 +632,7 @@ convertOmpSections(Operation &opInst, llvm::IRBuilderBase &builder,
637
632
// called for variables which have destructors/finalizers.
638
633
auto finiCB = [&](InsertPointTy codeGenIP) {};
639
634
640
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (
641
- builder.saveIP (), builder.getCurrentDebugLocation ());
635
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
642
636
builder.restoreIP (moduleTranslation.getOpenMPBuilder ()->createSections (
643
637
ompLoc, findAllocaInsertPoint (builder, moduleTranslation), sectionCBs,
644
638
privCB, finiCB, false , sectionsOp.nowait ()));
@@ -720,12 +714,7 @@ convertOmpWsLoop(Operation &opInst, llvm::IRBuilderBase &builder,
720
714
}
721
715
722
716
// Set up the source location value for OpenMP runtime.
723
- llvm::DISubprogram *subprogram =
724
- builder.GetInsertBlock ()->getParent ()->getSubprogram ();
725
- const llvm::DILocation *diLoc =
726
- moduleTranslation.translateLoc (opInst.getLoc (), subprogram);
727
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder.saveIP (),
728
- llvm::DebugLoc (diLoc));
717
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
729
718
730
719
// Generator of the canonical loop body.
731
720
// TODO: support error propagation in OpenMPIRBuilder and use it instead of
@@ -772,8 +761,7 @@ convertOmpWsLoop(Operation &opInst, llvm::IRBuilderBase &builder,
772
761
llvm::OpenMPIRBuilder::LocationDescription loc = ompLoc;
773
762
llvm::OpenMPIRBuilder::InsertPointTy computeIP = ompLoc.IP ;
774
763
if (i != 0 ) {
775
- loc = llvm::OpenMPIRBuilder::LocationDescription (bodyInsertPoints.back (),
776
- llvm::DebugLoc (diLoc));
764
+ loc = llvm::OpenMPIRBuilder::LocationDescription (bodyInsertPoints.back ());
777
765
computeIP = loopInfos.front ()->getPreheaderIP ();
778
766
}
779
767
loopInfos.push_back (ompBuilder->createCanonicalLoop (
@@ -788,7 +776,7 @@ convertOmpWsLoop(Operation &opInst, llvm::IRBuilderBase &builder,
788
776
// invalidated.
789
777
llvm::IRBuilderBase::InsertPoint afterIP = loopInfos.front ()->getAfterIP ();
790
778
llvm::CanonicalLoopInfo *loopInfo =
791
- ompBuilder->collapseLoops (diLoc , loopInfos, {});
779
+ ompBuilder->collapseLoops (ompLoc. DL , loopInfos, {});
792
780
793
781
allocaIP = findAllocaInsertPoint (builder, moduleTranslation);
794
782
@@ -922,13 +910,8 @@ convertOmpAtomicRead(Operation &opInst, llvm::IRBuilderBase &builder,
922
910
auto readOp = cast<omp::AtomicReadOp>(opInst);
923
911
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder ();
924
912
925
- // Set up the source location value for OpenMP runtime.
926
- llvm::DISubprogram *subprogram =
927
- builder.GetInsertBlock ()->getParent ()->getSubprogram ();
928
- const llvm::DILocation *diLoc =
929
- moduleTranslation.translateLoc (opInst.getLoc (), subprogram);
930
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder.saveIP (),
931
- llvm::DebugLoc (diLoc));
913
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
914
+
932
915
llvm::AtomicOrdering AO = convertAtomicOrdering (readOp.memory_order ());
933
916
llvm::Value *x = moduleTranslation.lookupValue (readOp.x ());
934
917
Type xTy = readOp.x ().getType ().cast <omp::PointerLikeType>().getElementType ();
@@ -949,13 +932,7 @@ convertOmpAtomicWrite(Operation &opInst, llvm::IRBuilderBase &builder,
949
932
auto writeOp = cast<omp::AtomicWriteOp>(opInst);
950
933
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder ();
951
934
952
- // Set up the source location value for OpenMP runtime.
953
- llvm::DISubprogram *subprogram =
954
- builder.GetInsertBlock ()->getParent ()->getSubprogram ();
955
- const llvm::DILocation *diLoc =
956
- moduleTranslation.translateLoc (opInst.getLoc (), subprogram);
957
- llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder.saveIP (),
958
- llvm::DebugLoc (diLoc));
935
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc (builder);
959
936
llvm::AtomicOrdering ao = convertAtomicOrdering (writeOp.memory_order ());
960
937
llvm::Value *expr = moduleTranslation.lookupValue (writeOp.value ());
961
938
llvm::Value *dest = moduleTranslation.lookupValue (writeOp.address ());
0 commit comments