File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed
Optimizer/OpenCLPasses/ManageableBarriers Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -6655,7 +6655,8 @@ namespace IGC
66556655
66566656 // Depend on vISA information about barriers presence to make sure that it's
66576657 // always set properly, even if a barrier is used as a part of Inline vISA code only.
6658- if (jitInfo->numBarriers != 0 )
6658+ if (jitInfo->numBarriers != 0 &&
6659+ !m_program->m_State .GetHasBarrier ())
66596660 {
66606661 if (context->getModuleMetaData ()->NBarrierCnt > 0 ||
66616662 additionalVISAAsmToLink)
Original file line number Diff line number Diff line change @@ -509,8 +509,8 @@ ManageableBarriersResolution::~ManageableBarriersResolution(void)
509509
510510bool ManageableBarriersResolution::runOnModule (Module& M)
511511{
512- mSimpleBarrierIDCount = 1 ;
513512 mModule = &M;
513+ bool isManageableBarriersAdded = false ;
514514 mCurrentMode = static_cast <MBMode>(IGC_GET_FLAG_VALUE (ManageableBarriersMode));
515515 for (auto & F : M)
516516 {
@@ -520,6 +520,9 @@ bool ManageableBarriersResolution::runOnModule(Module& M)
520520
521521 if (mManageBarrierInstructionsInit .size () > 0 )
522522 {
523+ mSimpleBarrierIDCount = 1 ;
524+ isManageableBarriersAdded = true ;
525+
523526 if (mCurrentMode == MBMode::Mix ||
524527 mCurrentMode == MBMode::SimpleOnly)
525528 {
@@ -552,13 +555,12 @@ bool ManageableBarriersResolution::runOnModule(Module& M)
552555 }
553556 }
554557
555- if (isManageableBarriersAdded () )
558+ if (isManageableBarriersAdded)
556559 {
557560 // Add attribute NBarrierCnt to metadata
558561 auto MD = getAnalysis<MetaDataUtilsWrapper>().getModuleMetaData ();
559562 // Adding max as it could be dynamic
560563 MD->NBarrierCnt = getMaxNamedBarrierCount ();
561-
562564 return true ;
563565 }
564566 return false ;
Original file line number Diff line number Diff line change @@ -156,13 +156,6 @@ namespace IGC
156156 void visitCallInst (llvm::CallInst& CI);
157157
158158 static bool HasHWSupport (GFXCORE_FAMILY GFX_CORE);
159-
160- private:
161- // / @brief Indicates if the pass changed the processed function
162- inline bool isManageableBarriersAdded ()
163- {
164- return mGlobalDataPoolPerFunc .size () > 0 ;
165- }
166159 };
167160
168161} // namespace IGC
You can’t perform that action at this time.
0 commit comments