Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first commit of supporting zext and sext #1398

Merged
merged 10 commits into from
Mar 15, 2024
Merged

Conversation

bjjwwang
Copy link
Contributor

@bjjwwang bjjwwang commented Mar 7, 2024

No description provided.

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 72.27723% with 56 lines in your changes are missing coverage. Please review.

Project coverage is 68.09%. Comparing base (246e0db) to head (7f177c2).
Report is 13 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1398      +/-   ##
==========================================
+ Coverage   67.80%   68.09%   +0.29%     
==========================================
  Files         250      250              
  Lines       27612    27770     +158     
==========================================
+ Hits        18721    18909     +188     
+ Misses       8891     8861      -30     
Files Coverage Δ
svf/include/AE/Core/BoundedZ3Expr.h 69.89% <100.00%> (+4.77%) ⬆️
svf/include/AE/Core/IntervalValue.h 78.64% <100.00%> (+0.48%) ⬆️
svf/include/AE/Core/NumericLiteral.h 79.68% <100.00%> (+1.28%) ⬆️
svf/include/AE/Svfexe/SVFIR2ItvExeState.h 100.00% <ø> (ø)
svf/include/SVFIR/SVFIR.h 100.00% <ø> (ø)
svf/include/SVFIR/SVFStatements.h 88.23% <100.00%> (ø)
svf/include/Util/GeneralType.h 100.00% <ø> (ø)
svf/lib/AE/Svfexe/BufOverflowChecker.cpp 78.34% <100.00%> (+0.26%) ⬆️
svf/lib/SVFIR/SVFFileSystem.cpp 87.00% <100.00%> (+0.02%) ⬆️
svf/lib/SVFIR/SVFIR.cpp 79.32% <100.00%> (ø)
... and 7 more

... and 8 files with indirect coverage changes

else if (SVFUtil::isa<llvm::SExtInst>(&inst))
{
addCopyEdge(src, dst, CopyStmt::SEXT);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to list all other types here

@@ -75,6 +74,10 @@ CopyStmt* SVFIR::addCopyStmt(NodeID src, NodeID dst)
return copyPE;
}
}
CopyStmt* SVFIR::addCopyStmt(NodeID src, NodeID dst)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this method?

@@ -743,7 +743,19 @@ void SVFIRBuilder::visitCastInst(CastInst &inst)
opnd = stripAllCasts(opnd);

NodeID src = getValueNode(opnd);
addCopyEdge(src, dst);
// if ZEXT
if(SVFUtil::isa<llvm::ZExtInst>(&inst))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to find all other invocation sites that calls addCopyEdge., like processCE, InitialGlobal, visitVAArgInst, visitFreezeInst, handleExtCall

if (_es[var->getId()].is_numeral()) {
if (bits == 8) {
int8_t signed_i8_value = _es[var->getId()].getIntNumeral();
uint32_t unsigned_value = static_cast<uint8_t>(signed_i8_value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint32_t => s32_t

return IntervalValue(unsigned_value, unsigned_value);
}
else if (bits == 16) {
int16_t signed_i16_value = _es[var->getId()].getIntNumeral();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int16_t = > s16_t

else if (copy->getCopyKind() == CopyStmt::FPTRUNC) {
_es[lhs] = getFPTruncValue(copy->getRHSVar(), copy->getLHSVar()->getType());
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need a else branch here

return CopyStmt::COPYVAL;
}
}
return CopyStmt::UNKNOWN;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have UNKNOWN? What is this for?

@@ -401,7 +401,7 @@ class SVFIRBuilder: public llvm::InstVisitor<SVFIRBuilder>
return CopyStmt::COPYVAL;
}
}
return CopyStmt::UNKNOWN;
assert (false && "Unknown cast inst!");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add a abort()

_es[lhs] = _es[rhs];
if (copy->getCopyKind() == CopyStmt::COPYVAL) {
_es[lhs] = _es[rhs];
}
if (copy->getCopyKind() == CopyStmt::ZEXT) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else if

@yuleisui yuleisui merged commit 75e0234 into SVF-tools:master Mar 15, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants