Skip to content

Commit 3e9dec8

Browse files
MichalMroz12pszymich
authored andcommitted
Reverting Coverity fixes
Reverting the changes of Coverity fixes due to performance regression (cherry picked from commit 1941204)
1 parent 95dc8c2 commit 3e9dec8

File tree

15 files changed

+36
-39
lines changed

15 files changed

+36
-39
lines changed

IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ getSPIRVBuiltinName(Op OC, SPIRVInstruction *BI, const std::vector<Type*>& ArgTy
279279

280280
if (!name.empty()) {
281281
name = name + suffix;
282-
decorateSPIRVBuiltin(name, std::move(ArgTypes));
282+
decorateSPIRVBuiltin(name, ArgTypes);
283283
}
284284
else
285285
{

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
426426
GenIntrinsicsTTIImpl GTTI(&ctx);
427427
return TargetTransformInfo(GTTI);
428428
});
429-
mpm.add(new TargetTransformInfoWrapperPass(std::move(GenTTgetIIRAnalysis)));
429+
mpm.add(new TargetTransformInfoWrapperPass(GenTTgetIIRAnalysis));
430430
}
431431

432432
// Disable all target library functions.

IGC/Compiler/MetaDataApi/IGCMetaDataHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void IGCMetaDataHelper::moveFunction(
3838
{
3939
auto funcInfo = loc->second;
4040
FuncMD.erase(OldFunc);
41-
FuncMD[NewFunc] = std::move(funcInfo);
41+
FuncMD[NewFunc] = funcInfo;
4242
}
4343
}
4444

IGC/Compiler/Optimizer/OpenCLPasses/GenericAddressResolution/LowerGPCallArg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void LowerGPCallArg::updateMetadata(Function* oldFunc, Function* newFunc) {
146146
{
147147
auto funcInfo = loc->second;
148148
FuncMD.erase(oldFunc);
149-
FuncMD[newFunc] = std::move(funcInfo);
149+
FuncMD[newFunc] = funcInfo;
150150
}
151151

152152
m_mdUtils->save(m_module->getContext());

IGC/Compiler/Optimizer/PreCompiledFuncImport.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,14 +2696,12 @@ void PreCompiledFuncImport::checkAndSetEnableSubroutine()
26962696
switch (I->getOpcode()) {
26972697
default:
26982698
break;
2699-
case Instruction::FDiv: {
2699+
case Instruction::FDiv:
27002700
if (DPDivSqrtEmu && I->getOperand(0)->getType()->isDoubleTy())
27012701
{
27022702
m_enableCallForEmulation = true;
27032703
m_pCtx->m_hasDPDivSqrtEmu = true;
27042704
}
2705-
break;
2706-
}
27072705
case Instruction::FMul:
27082706
case Instruction::FAdd:
27092707
case Instruction::FSub:

IGC/Compiler/compiler_caps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ namespace IGC
117117

118118
}
119119

120-
static void DumpCaps(const GT_SYSTEM_INFO &sysinfo, PLATFORM platformInfo, Debug::Dump const& dump)
120+
static void DumpCaps(const GT_SYSTEM_INFO sysinfo, PLATFORM platformInfo, Debug::Dump const& dump)
121121
{
122122
std::string outputString;
123123
CreateCompilerCapsString(&sysinfo, platformInfo, outputString);

IGC/OCLFE/igd_fcl_mcl/headers/common_clang.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ namespace Intel { namespace OpenCL { namespace ClangFE {
3636
//
3737
struct IOCLFEBinaryResult
3838
{
39-
IOCLFEBinaryResult(const IOCLFEBinaryResult& cm) = delete;
40-
IOCLFEBinaryResult& operator=(const IOCLFEBinaryResult& cm) = delete;
4139
// Returns the size in bytes of the IR buffer
4240
virtual size_t GetIRSize() const = 0;
4341
// Returns the pointer to the IR buffer or NULL if no IR buffer is present

visa/ByteCodeReaderNG.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,9 @@ static void readInstructionDataportNG(unsigned &bytePos, const char *buf,
775775
switch (opcode) {
776776
case ISA_MEDIA_ST:
777777
case ISA_MEDIA_LD: {
778-
uint8_t modifier = readPrimitiveOperandNG<uint8_t>(bytePos, buf);
778+
uint8_t modifier = (ISA_MEDIA_LD == opcode || ISA_MEDIA_ST == opcode)
779+
? readPrimitiveOperandNG<uint8_t>(bytePos, buf)
780+
: 0;
779781
uint8_t surface = readPrimitiveOperandNG<uint8_t>(bytePos, buf);
780782
uint8_t plane = (ISA_MEDIA_LD == opcode || ISA_MEDIA_ST == opcode)
781783
? readPrimitiveOperandNG<uint8_t>(bytePos, buf)

visa/FlowGraph.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -382,16 +382,14 @@ int64_t FlowGraph::insertDummyUUIDMov() {
382382
builder->createMov(g4::SIMD1, nullDst, randImm, InstOpt_NoOpt, false);
383383

384384
auto instItEnd = bb->end();
385-
auto it = bb->begin();
386-
387-
if (it != instItEnd) {
388-
if ((*it)->isLabel()) {
389-
bb->insertBefore(++it, movInst);
390-
return uuID;
391-
}
392-
393-
bb->push_front(movInst);
385+
for (auto it = bb->begin(); it != instItEnd; it++) {
386+
if ((*it)->isLabel()) {
387+
bb->insertBefore(++it, movInst);
394388
return uuID;
389+
}
390+
391+
bb->push_front(movInst);
392+
return uuID;
395393
}
396394
}
397395
}

visa/G4_IR.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2772,6 +2772,7 @@ bool G4_INST::isRAWdep(G4_INST *inst) {
27722772
G4_Operand *dst0 = inst->getDst();
27732773
G4_CondMod *cMod0 = inst->getCondMod();
27742774
G4_Operand *implicitDst0 = inst->getImplAccDst();
2775+
G4_Operand *msg1 = NULL;
27752776
G4_Predicate *pred1 = getPredicate();
27762777
G4_Operand *src1_0 = getSrc(0);
27772778
G4_Operand *src1_1 = getSrc(1);
@@ -2789,6 +2790,7 @@ bool G4_INST::isRAWdep(G4_INST *inst) {
27892790
src1_2->compareOperand(dst0, getBuilder()) != Rel_disjoint) ||
27902791
(src1_3 &&
27912792
src1_3->compareOperand(dst0, getBuilder()) != Rel_disjoint) ||
2793+
(msg1 && msg1->compareOperand(dst0, getBuilder()) != Rel_disjoint) ||
27922794
(pred1 && pred1->compareOperand(dst0, getBuilder()) != Rel_disjoint) ||
27932795
(implicitSrc1 &&
27942796
implicitSrc1->compareOperand(dst0, getBuilder()) != Rel_disjoint)) {
@@ -3893,7 +3895,7 @@ uint8_t G4_SrcRegRegion::getMaxExecSize(const IR_Builder &builder, int pos,
38933895
// conservative.
38943896
// Here we assume that no cross width if row size is larger than width
38953897
// mul (16) V112(0,0)<1>:f V111(0,0)<16;16,1>:f r1.0<1;4,0>:f
3896-
if (!alignToRow && desc->vertStride != 0 &&
3898+
if (!alignToRow && !contRegion && desc->vertStride != 0 &&
38973899
desc->horzStride != 0) {
38983900
wd = vs =
38993901
(uint16_t)roundDownPow2((pos / desc->width + 1) * desc->width - pos);
@@ -3926,7 +3928,7 @@ uint8_t G4_SrcRegRegion::getMaxExecSize(const IR_Builder &builder, int pos,
39263928
eleInFirstRow = desc->width - posInFirstRow;
39273929
uint8_t pow2 = roundDownPow2(eleInFirstRow);
39283930

3929-
if (eleInFirstRow != pow2) {
3931+
if (eleInFirstRow != pow2 && !contRegion) {
39303932
wd = pow2;
39313933
vs = wd * desc->horzStride;
39323934
return pow2;
@@ -3950,7 +3952,7 @@ uint8_t G4_SrcRegRegion::getMaxExecSize(const IR_Builder &builder, int pos,
39503952
elSize;
39513953

39523954
// check cross row boundary
3953-
if (posInRow == 0) {
3955+
if ((!contRegion || desc->vertStride == 0) && posInRow == 0) {
39543956
uint8_t pow2Val = roundDownPow2(eleInRow);
39553957
if (pow2Val != eleInRow ||
39563958
((desc->vertStride == 0 || negVS) && !alignToRow)) {
@@ -3984,7 +3986,7 @@ uint8_t G4_SrcRegRegion::getMaxExecSize(const IR_Builder &builder, int pos,
39843986
// subregister offset of two GRFs are different and not contiguous(too
39853987
// conservative?)
39863988
if (pow2Val != maxSize ||
3987-
(!(alignToRow && maxSize <= desc->width) &&
3989+
(!contRegion && !(alignToRow && maxSize <= desc->width) &&
39883990
newLB % builder.numEltPerGRF<Type_UB>() !=
39893991
(getLeftBound() + currPos) %
39903992
builder.numEltPerGRF<Type_UB>())) {
@@ -4006,7 +4008,7 @@ uint8_t G4_SrcRegRegion::getMaxExecSize(const IR_Builder &builder, int pos,
40064008
maxSize++;
40074009
eleInRow++;
40084010
// make sure the number of elements in two rows are the same
4009-
if (crossRow && eleInRow == eleInFirstRow && !alignToRow) {
4011+
if (crossRow && eleInRow == eleInFirstRow && !alignToRow && !contRegion) {
40104012
break;
40114013
}
40124014

@@ -5308,7 +5310,7 @@ unsigned G4_Predicate::computeRightBound(uint8_t exec_size) {
53085310

53095311
right_bound = left_bound + totalBits - 1;
53105312

5311-
bitVec[0] = exec_size >= 32 ? 0xFFFFFFFF : (1 << exec_size) - 1;
5313+
bitVec[0] = exec_size == 32 ? 0xFFFFFFFF : (1 << exec_size) - 1;
53125314
}
53135315

53145316
return right_bound;

0 commit comments

Comments
 (0)