Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@ static bool isConflictIP(IRBuilder<>::InsertPoint IP1,
return IP1.getBlock() == IP2.getBlock() && IP1.getPoint() == IP2.getPoint();
}

/// This is wrapper over IRBuilderBase::restoreIP that also restores the current
/// debug location to the last instruction in the specified basic block if the
/// insert point points to the end of the block.
static void restoreIPandDebugLoc(llvm::IRBuilderBase &Builder,
llvm::IRBuilderBase::InsertPoint IP) {
Builder.restoreIP(IP);
llvm::BasicBlock *BB = Builder.GetInsertBlock();
llvm::BasicBlock::iterator I = Builder.GetInsertPoint();
if (!BB->empty() && I == BB->end())
Builder.SetCurrentDebugLocation(BB->back().getStableDebugLoc());
}

static bool isValidWorkshareLoopScheduleType(OMPScheduleType SchedType) {
// Valid ordered/unordered and base algorithm combinations.
switch (SchedType & ~OMPScheduleType::MonotonicityMask) {
Expand Down Expand Up @@ -163,6 +151,18 @@ static bool isValidWorkshareLoopScheduleType(OMPScheduleType SchedType) {
}
#endif

/// This is wrapper over IRBuilderBase::restoreIP that also restores the current
/// debug location to the last instruction in the specified basic block if the
/// insert point points to the end of the block.
static void restoreIPandDebugLoc(llvm::IRBuilderBase &Builder,
llvm::IRBuilderBase::InsertPoint IP) {
Builder.restoreIP(IP);
llvm::BasicBlock *BB = Builder.GetInsertBlock();
llvm::BasicBlock::iterator I = Builder.GetInsertPoint();
if (!BB->empty() && I == BB->end())
Builder.SetCurrentDebugLocation(BB->back().getStableDebugLoc());
}

static const omp::GV &getGridValue(const Triple &T, Function *Kernel) {
if (T.isAMDGPU()) {
StringRef Features =
Expand Down