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
6655
6655
6656
6656
// Depend on vISA information about barriers presence to make sure that it's
6657
6657
// 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 ())
6659
6660
{
6660
6661
if (context->getModuleMetaData ()->NBarrierCnt > 0 ||
6661
6662
additionalVISAAsmToLink)
Original file line number Diff line number Diff line change @@ -509,8 +509,8 @@ ManageableBarriersResolution::~ManageableBarriersResolution(void)
509
509
510
510
bool ManageableBarriersResolution::runOnModule (Module& M)
511
511
{
512
- mSimpleBarrierIDCount = 1 ;
513
512
mModule = &M;
513
+ bool isManageableBarriersAdded = false ;
514
514
mCurrentMode = static_cast <MBMode>(IGC_GET_FLAG_VALUE (ManageableBarriersMode));
515
515
for (auto & F : M)
516
516
{
@@ -520,6 +520,9 @@ bool ManageableBarriersResolution::runOnModule(Module& M)
520
520
521
521
if (mManageBarrierInstructionsInit .size () > 0 )
522
522
{
523
+ mSimpleBarrierIDCount = 1 ;
524
+ isManageableBarriersAdded = true ;
525
+
523
526
if (mCurrentMode == MBMode::Mix ||
524
527
mCurrentMode == MBMode::SimpleOnly)
525
528
{
@@ -552,13 +555,12 @@ bool ManageableBarriersResolution::runOnModule(Module& M)
552
555
}
553
556
}
554
557
555
- if (isManageableBarriersAdded () )
558
+ if (isManageableBarriersAdded)
556
559
{
557
560
// Add attribute NBarrierCnt to metadata
558
561
auto MD = getAnalysis<MetaDataUtilsWrapper>().getModuleMetaData ();
559
562
// Adding max as it could be dynamic
560
563
MD->NBarrierCnt = getMaxNamedBarrierCount ();
561
-
562
564
return true ;
563
565
}
564
566
return false ;
Original file line number Diff line number Diff line change @@ -156,13 +156,6 @@ namespace IGC
156
156
void visitCallInst (llvm::CallInst& CI);
157
157
158
158
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
- }
166
159
};
167
160
168
161
} // namespace IGC
You can’t perform that action at this time.
0 commit comments