|
Static Value-Flow Analysis
|
#include "AE/Svfexe/AbstractInterpretation.h"#include "AE/Svfexe/AbsExtAPI.h"#include "SVFIR/SVFIR.h"#include "Util/Options.h"#include "Util/WorkList.h"#include "Graphs/CallGraph.h"#include "WPA/Andersen.h"#include <cmath>#include <deque>Go to the source code of this file.
Functions | |
| static const LoadStmt * | findBackingLoad (const SVFVar *var) |
| static IntervalValue | computeCmpConstraint (s32_t predicate, s64_t succ, bool isLHS, const IntervalValue &self, const IntervalValue &other) |
|
static |
Compute the interval constraint on one cmp operand given the predicate, branch direction (succ), which side it is on, and the other operand's interval. Returns top if no useful narrowing is possible.
Called from isCmpBranchFeasible for each non-constant operand that has a backing load. Given a branch condition like:
cmp = icmp sgt a, 5 ; a > 5 br i1 cmp, label T, F
On the true branch (succ=1), operand a (isLHS=true) is constrained to [6, +inf). On the false branch (succ=0), a is constrained to (-inf, 5]. The result is used to narrow the ObjVar behind a's load.
Definition at line 310 of file AbstractInterpretation.cpp.
Given a cmp operand, walk its SSA def edge to find the LoadStmt that produced it. This lets us trace back to the ObjVar in memory so that branch narrowing can refine the stored value.
Example: for cmp = icmp sgt a, 5 where a = load i32, ptr p, calling findBackingLoad(a) returns the LoadStmt, and we can then narrow the ObjVar behind p.
Follows one level of CopyStmt (e.g., zext/sext) if the load is not directly on the cmp operand. Returns nullptr if no load is found.
Definition at line 281 of file AbstractInterpretation.cpp.