Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions src/numba/openmp/libs/pass/CGIntrinsicsOpenMP.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -523,7 +523,7 @@ OutlinedInfoStruct CGIntrinsicsOpenMP::createOutlinedFunction(
DEBUG_ENABLE(dbgs() << "=== Dump OutlinedFn\n"
<< *OutlinedFn << "=== End of Dump OutlinedFn\n");

if (verifyFunction(*OutlinedFn, &errs()))
if (DebugOpenMPFlag && verifyFunction(*OutlinedFn, &errs()))
FATAL_ERROR("Verification of OutlinedFn failed!");

CapturedVars.append(CapturedShared);
Expand DownExpand Up@@ -680,7 +680,7 @@ void CGIntrinsicsOpenMP::emitOMPParallelHostRuntime(
DEBUG_ENABLE(dbgs() << "=== Dump OuterFn\n"
<< *Fn << "=== End of Dump OuterFn\n");

if (verifyFunction(*Fn, &errs()))
if (DebugOpenMPFlag && verifyFunction(*Fn, &errs()))
FATAL_ERROR("Verification of OuterFn failed!");
}

Expand DownExpand Up@@ -756,7 +756,7 @@ void CGIntrinsicsOpenMP::emitOMPParallelDeviceRuntime(
assert(OutlinedCI && "Expected valid call");
OMPBuilder.Builder.CreateRetVoid();

if (verifyFunction(*OutlinedWrapperFn, &errs()))
if (DebugOpenMPFlag && verifyFunction(*OutlinedWrapperFn, &errs()))
FATAL_ERROR("Verification of OutlinedWrapperFn failed!");

DEBUG_ENABLE(dbgs() << "=== Dump OutlinedWrapper\n"
Expand DownExpand Up@@ -903,7 +903,7 @@ void CGIntrinsicsOpenMP::emitOMPParallelDeviceRuntime(
DEBUG_ENABLE(dbgs() << "=== Dump OuterFn\n"
<< *Fn << "=== End of Dump OuterFn\n");

if (verifyFunction(*Fn, &errs()))
if (DebugOpenMPFlag && verifyFunction(*Fn, &errs()))
FATAL_ERROR("Verification of OuterFn failed!");
}

Expand DownExpand Up@@ -1386,7 +1386,7 @@ void CGIntrinsicsOpenMP::emitLoop(DSAValueMapTy &DSAValueMap,
FATAL_ERROR("Failed to create barrier: " + toString(std::move(E)));
}

if (verifyFunction(*PreHeader->getParent(), &errs()))
if (DebugOpenMPFlag && verifyFunction(*PreHeader->getParent(), &errs()))
FATAL_ERROR("Verification of omp for lowering failed!");
}

Expand DownExpand Up@@ -2542,7 +2542,7 @@ void CGIntrinsicsOpenMP::emitOMPTeamsDeviceRuntime(
DEBUG_ENABLE(dbgs() << "=== Dump OuterFn\n"
<< *Fn << "=== End of Dump OuterFn\n");

if (verifyFunction(*Fn, &errs()))
if (DebugOpenMPFlag && verifyFunction(*Fn, &errs()))
FATAL_ERROR("Verification of OuterFn failed!");
}

Expand DownExpand Up@@ -2626,7 +2626,7 @@ void CGIntrinsicsOpenMP::emitOMPTeamsHostRuntime(
DEBUG_ENABLE(dbgs() << "=== Dump OuterFn\n"
<< *Fn << "=== End of Dump OuterFn\n");

if (verifyFunction(*Fn, &errs()))
if (DebugOpenMPFlag && verifyFunction(*Fn, &errs()))
FATAL_ERROR("Verification of OuterFn failed!");
}

Expand Down
22 changes: 7 additions & 15 deletions src/numba/openmp/libs/pass/DebugOpenMP.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,26 +3,18 @@

#include <string>

#ifdef NDEBUG

#define DEBUG_ENABLE(X)
#define DebugOpenMPInit()

#else

extern bool DebugOpenMPFlag;
void DebugOpenMPInit();

#define DEBUG_ENABLE(X) \
do { \
if (DebugOpenMPFlag) { \
X; \
} \
} while (false)
do { \
if (DebugOpenMPFlag) { \
X; \
} \
} while (false)

#endif

[[noreturn]] void fatalError(const std::string &msg, const char *file, int line);
[[noreturn]] void fatalError(const std::string &msg, const char *file,
int line);
#define FATAL_ERROR(msg) fatalError(msg, __FILE__, __LINE__)

#endif
4 changes: 2 additions & 2 deletions src/numba/openmp/libs/pass/IntrinsicsOpenMP.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -708,7 +708,7 @@ struct IntrinsicsOpenMP {
FATAL_ERROR("Unknown directive");
}

if (verifyFunction(*Fn, &errs()))
if (DebugOpenMPFlag && verifyFunction(*Fn, &errs()))
FATAL_ERROR("Verification of IntrinsicsOpenMP lowering failed!");
}
}
Expand DownExpand Up@@ -827,7 +827,7 @@ extern "C" int runIntrinsicsOpenMPPass(const char *BitcodePtr,
MPM.run(*M, MAM);

// Verify the module before writing bitcode
if (verifyModule(*M, &errs())) {
if (DebugOpenMPFlag && verifyModule(*M, &errs())) {
errs() << "ERROR: Module verification failed after IntrinsicsOpenMPPass\n";
return 1;
}
Expand Down
Loading