Skip to content

Commit 3746bd2

Browse files
authored
[OMPIRBuilder][NFC] Fix build failure after 151306. (#153061)
A function added in pr#151306 was under NDEBUG macro which caused the build to fail in certain cases. It has been moved out of the #ifdef check to ensure it is always compiled.
1 parent 2bf2b6b commit 3746bd2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
10795
static 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+
166166
static const omp::GV &getGridValue(const Triple &T, Function *Kernel) {
167167
if (T.isAMDGPU()) {
168168
StringRef Features =

0 commit comments

Comments
 (0)