Skip to content

Commit 9c8de86

Browse files
fda0igcbot
authored andcommitted
Initialize variables. Reduce copying. Promote types.
Addresses Coverity issues.
1 parent b15ef7b commit 9c8de86

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

IGC/Compiler/CISACodeGen/IGCVectorizer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ unsigned int getVectorSize(Value *I) {
184184
bool isFDivSafe(Instruction *I) {
185185
if (!IGC_GET_FLAG_VALUE(VectorizerAllowFDIV)) return false;
186186
auto* Binary = llvm::dyn_cast<BinaryOperator>(I);
187+
if (!Binary) return false;
188+
187189
auto OpCode = Binary->getOpcode();
188190
if (!(OpCode == Instruction::FDiv && I->getType()->isFloatTy())) return false;
189191

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3391,7 +3391,7 @@ std::vector<std::pair<unsigned int, std::string>> GetPrintfStrings(Module &M)
33913391
{
33923392
MDNode* argMDNode = printfMDNode->getOperand(i);
33933393
ConstantInt* indexOpndVal =
3394-
mdconst::dyn_extract<ConstantInt>(argMDNode->getOperand(0));
3394+
mdconst::extract<ConstantInt>(argMDNode->getOperand(0));
33953395
MDString* stringOpndVal =
33963396
dyn_cast<MDString>(argMDNode->getOperand(1));
33973397

IGC/Compiler/MetaDataApi/IGCMetaDataHelper.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ void IGCMetaDataHelper::copyFunction(
5858
auto loc = FuncMD.find(OldFunc);
5959
if (loc != FuncMD.end())
6060
{
61-
auto funcInfo = loc->second;
62-
FuncMD[NewFunc] = funcInfo;
61+
FuncMD[NewFunc] = loc->second;
6362
}
6463
}
6564

0 commit comments

Comments
 (0)