builder.CreateBr(entryBB);
builder.SetInsertPoint(entryBB);
}
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(
- builder.saveIP(), builder.getCurrentDebugLocation());
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
builder.restoreIP(moduleTranslation.getOpenMPBuilder()->createParallel(
ompLoc, findAllocaInsertPoint(builder, moduleTranslation), bodyGenCB,
privCB, finiCB, ifCond, numThreads, pbKind, isCancellable));
// called for variables which have destructors/finalizers.
auto finiCB = [&](InsertPointTy codeGenIP) {};
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(
- builder.saveIP(), builder.getCurrentDebugLocation());
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
builder.restoreIP(moduleTranslation.getOpenMPBuilder()->createMaster(
ompLoc, bodyGenCB, finiCB));
return success();
// called for variables which have destructors/finalizers.
auto finiCB = [&](InsertPointTy codeGenIP) {};
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(
- builder.saveIP(), builder.getCurrentDebugLocation());
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
llvm::LLVMContext &llvmContext = moduleTranslation.getLLVMContext();
llvm::Constant *hint = nullptr;
SmallVector<llvm::Value *> vecValues =
moduleTranslation.lookupValues(orderedOp.depend_vec_vars());
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(
- builder.saveIP(), builder.getCurrentDebugLocation());
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
size_t indexVecValues = 0;
while (indexVecValues < vecValues.size()) {
SmallVector<llvm::Value *> storeValues;
// called for variables which have destructors/finalizers.
auto finiCB = [&](InsertPointTy codeGenIP) {};
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(
- builder.saveIP(), builder.getCurrentDebugLocation());
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
builder.restoreIP(
moduleTranslation.getOpenMPBuilder()->createOrderedThreadsSimd(
ompLoc, bodyGenCB, finiCB, !orderedRegionOp.simd()));
// called for variables which have destructors/finalizers.
auto finiCB = [&](InsertPointTy codeGenIP) {};
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(
- builder.saveIP(), builder.getCurrentDebugLocation());
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
builder.restoreIP(moduleTranslation.getOpenMPBuilder()->createSections(
ompLoc, findAllocaInsertPoint(builder, moduleTranslation), sectionCBs,
privCB, finiCB, false, sectionsOp.nowait()));
}
// Set up the source location value for OpenMP runtime.
- llvm::DISubprogram *subprogram =
- builder.GetInsertBlock()->getParent()->getSubprogram();
- const llvm::DILocation *diLoc =
- moduleTranslation.translateLoc(opInst.getLoc(), subprogram);
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder.saveIP(),
- llvm::DebugLoc(diLoc));
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
// Generator of the canonical loop body.
// TODO: support error propagation in OpenMPIRBuilder and use it instead of
llvm::OpenMPIRBuilder::LocationDescription loc = ompLoc;
llvm::OpenMPIRBuilder::InsertPointTy computeIP = ompLoc.IP;
if (i != 0) {
- loc = llvm::OpenMPIRBuilder::LocationDescription(bodyInsertPoints.back(),
- llvm::DebugLoc(diLoc));
+ loc = llvm::OpenMPIRBuilder::LocationDescription(bodyInsertPoints.back());
computeIP = loopInfos.front()->getPreheaderIP();
}
loopInfos.push_back(ompBuilder->createCanonicalLoop(
// invalidated.
llvm::IRBuilderBase::InsertPoint afterIP = loopInfos.front()->getAfterIP();
llvm::CanonicalLoopInfo *loopInfo =
- ompBuilder->collapseLoops(diLoc, loopInfos, {});
+ ompBuilder->collapseLoops(ompLoc.DL, loopInfos, {});
allocaIP = findAllocaInsertPoint(builder, moduleTranslation);
auto readOp = cast<omp::AtomicReadOp>(opInst);
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder();
- // Set up the source location value for OpenMP runtime.
- llvm::DISubprogram *subprogram =
- builder.GetInsertBlock()->getParent()->getSubprogram();
- const llvm::DILocation *diLoc =
- moduleTranslation.translateLoc(opInst.getLoc(), subprogram);
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder.saveIP(),
- llvm::DebugLoc(diLoc));
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
+
llvm::AtomicOrdering AO = convertAtomicOrdering(readOp.memory_order());
llvm::Value *x = moduleTranslation.lookupValue(readOp.x());
Type xTy = readOp.x().getType().cast<omp::PointerLikeType>().getElementType();
auto writeOp = cast<omp::AtomicWriteOp>(opInst);
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder();
- // Set up the source location value for OpenMP runtime.
- llvm::DISubprogram *subprogram =
- builder.GetInsertBlock()->getParent()->getSubprogram();
- const llvm::DILocation *diLoc =
- moduleTranslation.translateLoc(opInst.getLoc(), subprogram);
- llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder.saveIP(),
- llvm::DebugLoc(diLoc));
+ llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
llvm::AtomicOrdering ao = convertAtomicOrdering(writeOp.memory_order());
llvm::Value *expr = moduleTranslation.lookupValue(writeOp.value());
llvm::Value *dest = moduleTranslation.lookupValue(writeOp.address());