-
Notifications
You must be signed in to change notification settings - Fork 436
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ 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
|
svf-llvm/lib/SVFIRBuilder.cpp
Outdated
else if (SVFUtil::isa<llvm::SExtInst>(&inst)) | ||
{ | ||
addCopyEdge(src, dst, CopyStmt::SEXT); | ||
} |
There was a problem hiding this comment.
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
svf/lib/SVFIR/SVFIR.cpp
Outdated
@@ -75,6 +74,10 @@ CopyStmt* SVFIR::addCopyStmt(NodeID src, NodeID dst) | |||
return copyPE; | |||
} | |||
} | |||
CopyStmt* SVFIR::addCopyStmt(NodeID src, NodeID dst) |
There was a problem hiding this comment.
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?
svf-llvm/lib/SVFIRBuilder.cpp
Outdated
@@ -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)) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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()); | ||
} | ||
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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!"); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if
No description provided.