Skip to content

Commit

Permalink
Fix coverity issues
Browse files Browse the repository at this point in the history
.
  • Loading branch information
KorovinVlad authored and igcbot committed Sep 20, 2024
1 parent bf295fd commit 43e3067
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IGC/VectorCompiler/lib/Utils/GenX/CostInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ static float extractConstantFloatMD(const MDOperand &Op) {
ConstantFP *V = nullptr;
if (auto *VM = dyn_cast<ValueAsMetadata>(Op))
V = dyn_cast<ConstantFP>(VM->getValue());
IGC_ASSERT_MESSAGE(V, "Unexpected null value in metadata");
IGC_ASSERT_EXIT_MESSAGE(V, "Unexpected null value in metadata");
return V->getValue().convertToFloat();
}

static int extractConstantIntMD(const MDOperand &Op) {
ConstantInt *V = nullptr;
if (auto *VM = dyn_cast<ValueAsMetadata>(Op))
V = dyn_cast<ConstantInt>(VM->getValue());
IGC_ASSERT_MESSAGE(V, "Unexpected null value in metadata");
IGC_ASSERT_EXIT_MESSAGE(V, "Unexpected null value in metadata");
return V->getSExtValue();
}

Expand Down

0 comments on commit 43e3067

Please sign in to comment.