diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp index 0bf0c832d5ddf..177ae9a47db75 100644 --- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp +++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp @@ -1516,6 +1516,8 @@ OpenMPIRBuilder::applyStaticWorkshareLoop(DebugLoc DL, CanonicalLoopInfo *CLI, InsertPointTy AllocaIP, bool NeedsBarrier, Value *Chunk) { assert(CLI->isValid() && "Requires a valid canonical loop"); + assert(!isConflictIP(AllocaIP, CLI->getPreheaderIP()) && + "Require dedicated allocate IP"); // Set up the source location value for OpenMP runtime. Builder.restoreIP(CLI->getPreheaderIP()); @@ -1646,6 +1648,8 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::applyDynamicWorkshareLoop( DebugLoc DL, CanonicalLoopInfo *CLI, InsertPointTy AllocaIP, OMPScheduleType SchedType, bool NeedsBarrier, Value *Chunk) { assert(CLI->isValid() && "Requires a valid canonical loop"); + assert(!isConflictIP(AllocaIP, CLI->getPreheaderIP()) && + "Require dedicated allocate IP"); // Set up the source location value for OpenMP runtime. Builder.SetCurrentDebugLocation(DL);