@@ -92,18 +92,6 @@ static bool isConflictIP(IRBuilder<>::InsertPoint IP1,
9292 return IP1.getBlock () == IP2.getBlock () && IP1.getPoint () == IP2.getPoint ();
9393}
9494
95- // / This is wrapper over IRBuilderBase::restoreIP that also restores the current
96- // / debug location to the last instruction in the specified basic block if the
97- // / insert point points to the end of the block.
98- static void restoreIPandDebugLoc (llvm::IRBuilderBase &Builder,
99- llvm::IRBuilderBase::InsertPoint IP) {
100- Builder.restoreIP (IP);
101- llvm::BasicBlock *BB = Builder.GetInsertBlock ();
102- llvm::BasicBlock::iterator I = Builder.GetInsertPoint ();
103- if (!BB->empty () && I == BB->end ())
104- Builder.SetCurrentDebugLocation (BB->back ().getStableDebugLoc ());
105- }
106-
10795static bool isValidWorkshareLoopScheduleType (OMPScheduleType SchedType) {
10896 // Valid ordered/unordered and base algorithm combinations.
10997 switch (SchedType & ~OMPScheduleType::MonotonicityMask) {
@@ -163,6 +151,18 @@ static bool isValidWorkshareLoopScheduleType(OMPScheduleType SchedType) {
163151}
164152#endif
165153
154+ // / This is wrapper over IRBuilderBase::restoreIP that also restores the current
155+ // / debug location to the last instruction in the specified basic block if the
156+ // / insert point points to the end of the block.
157+ static void restoreIPandDebugLoc (llvm::IRBuilderBase &Builder,
158+ llvm::IRBuilderBase::InsertPoint IP) {
159+ Builder.restoreIP (IP);
160+ llvm::BasicBlock *BB = Builder.GetInsertBlock ();
161+ llvm::BasicBlock::iterator I = Builder.GetInsertPoint ();
162+ if (!BB->empty () && I == BB->end ())
163+ Builder.SetCurrentDebugLocation (BB->back ().getStableDebugLoc ());
164+ }
165+
166166static const omp::GV &getGridValue (const Triple &T, Function *Kernel) {
167167 if (T.isAMDGPU ()) {
168168 StringRef Features =
0 commit comments