Commit 23f4cb12 authored by Chen, Weiyu's avatar Chen, Weiyu Committed by gbsbuild

remove software fence intrinsic before binary encoding

Change-Id: I3109e3f2282c5115e518b1f2c6ae6788c04659df
parent ee8d0508
......@@ -496,6 +496,11 @@ public:
// reset this BB's instruction's local id so they are [0,..#BBInst-1]
void resetLocalId();
void removeIntrinsics(Intrinsic intrinId)
{
instList.remove_if([=](G4_INST* inst) { return inst->isIntrinsic() && inst->asIntrinsicInst()->getIntrinsicId() == intrinId;});
}
};
}
......
......@@ -276,15 +276,10 @@ static void verifyVariableDecl(const common_isa_header& isaHeader, const kernel_
break; // Prevent gcc warning
}
int varSize = var->num_elements * CISATypeTable[var->getType()].typeSize;
REPORT_HEADER(options, var->num_elements != 0 && var->num_elements <= 4096,
"V%d's number of elements(%d) is out of range: %s",
declID + numPreDefinedVars, var->num_elements,
declError.c_str());
REPORT_HEADER(options, varSize < COMMON_ISA_MAX_VARIABLE_SIZE,
"V%d's size(%d) exceeds the maximum allowed limit (4K): %s",
declID + numPreDefinedVars, varSize, declError.c_str());
REPORT_HEADER(options, !(var->alias_index == 0 && var->alias_offset != 0),
"V%d's alias offset must be zero when it is not aliased: %s",
declID + numPreDefinedVars, declError.c_str());
......
......@@ -305,6 +305,13 @@ void* VISAKernelImpl::compilePostOptimize(unsigned int& binarySize)
expandIndirectCallWithRegTarget();
}
// remove SW fences at this point
// ToDo: remove all intrinsics?
for (auto bb : m_kernel->fg.BBs)
{
bb->removeIntrinsics(Intrinsic::MemFence);
}
m_kernel->evalAddrExp();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment