Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • opensrc/SMPStaticAnalyzer
1 result
Show changes
Commits on Source (13)
Showing
with 48585 additions and 48176 deletions
......@@ -480,7 +480,7 @@ public:
void UpdateDownExposedDefs(STARSOpndTypePtr DefOp, STARS_ea_t InstAddr); // Add DefOp, remove previous defs of DefOp that now do not reach the end of the block.
void SCCPEvaluateConstants(enum STARSBranchConst &BranchEval, std::list<std::pair<int, int> > &CFGWorkList, std::list<std::pair<int, int> > &SSAWorkList); // Evaluate constants for all instructions as part of SCCP algorithm at SMPFunction level.
void SCCPGlobalPropagationHelper(const STARSOpndTypePtr &GlobalOp, int DefSSANum, std::vector<STARSBitSet> ExecutedEdgeBitSet, std::list<std::pair<int, int> > &CFGWorkList, std::list<std::pair<int, int> > &SSAWorkList); // Propagate GlobalOp/DefSSANum const value
void SCCPGlobalPropagationHelper(const STARSOpndTypePtr &GlobalOp, int DefSSANum, const std::vector<STARSBitSet> &ExecutedEdgeBitSet, std::list<std::pair<int, int> > &CFGWorkList, std::list<std::pair<int, int> > &SSAWorkList); // Propagate GlobalOp/DefSSANum const value
void SCCPHandleSuccessors(enum STARSBranchConst &BranchEval, std::list<std::pair<int, int> > &CFGWorkList); // Based on BranchEval, push successors onto CFGWorkList
void SCCPNullifyUnreachableBlock(void); // Patch binary to make this block into nops.
void SCCPGatherStatistics(void); // Gather statistics on SCCP effectiveness
......
......@@ -250,23 +250,23 @@ typedef std::list<std::pair<STARSExprSetIter, std::pair<std::size_t, int> > > ST
typedef STARSMemWriteExprsList::iterator STARSMemWriteExprListIter;
// Debug dump of induction variable.
void DumpInductionVar(const struct InductionVarTriple IndVar);
void DumpInductionVar(const struct InductionVarTriple &IndVar);
// Debug dump of InductionVarFamily.
void DumpInductionVarFamily(const struct InductionVarFamily IVFamily);
void DumpInductionVarFamily(const struct InductionVarFamily &IVFamily);
// Debug dump of LoopComparison struct.
void DumpLoopComparison(const struct LoopComparison Expr);
void DumpLoopComparison(const struct LoopComparison &Expr);
// Emit annotation for induction variable.
void EmitInductionVarAnnotation(const struct InductionVarTriple IndVar);
void EmitInductionVarAnnotation(const struct InductionVarTriple &IndVar);
// Emit annotations for InductionVarFamily.
void EmitInductionVarFamilyAnnotations(const struct InductionVarFamily IVFamily);
void EmitInductionVarFamilyAnnotations(const struct InductionVarFamily &IVFamily);
// Determine whether we have an incrementing or decrementing loop based on
// the BasicInductionVar.
bool IsPositiveIncrementBIV(const struct InductionVarTriple BIV);
bool IsPositiveIncrementBIV(const struct InductionVarTriple &BIV);
static char StaticFuncName[MAXSMPSTR];
......@@ -350,7 +350,7 @@ public:
STARS_ea_t GetFirstUnprocessedCallee(void); // first addr of first callee in AllCallTargets with Processed == false
inline std::size_t GetNumBlocks(void) const { return Blocks.size(); };
inline std::size_t GetNumTCFGBlocks(void) const { return TCFGBlocks.size(); };
STARSOpndTypePtr GetNormalizedOperand(STARS_ea_t InstAddr, const STARSOpndTypePtr &RTLop); // Return RTLop if not stack opnd; return normalized RTLop otherwise.
STARSOpndTypePtr GetNormalizedOperand(STARS_ea_t InstAddr, const STARSOpndTypePtr &RTLop, bool DEFFlag); // Return RTLop if not stack opnd; return normalized RTLop otherwise.
inline int GetReturnRegType(STARS_regnum_t RegNum) const { return ((RegNum < (decltype(RegNum))ReturnRegTypes.size()) ? (int) ReturnRegTypes[RegNum] : 0); };
inline struct FineGrainedInfo GetReturnRegFGInfo(STARS_regnum_t RegNum) const { return ReturnRegFGInfo.at(RegNum); };
inline std::size_t GetReturnRegFGInfoSize(void) const { return ReturnRegFGInfo.size(); };
......@@ -477,7 +477,7 @@ public:
inline void SetCallerSavedLocalReg(STARS_regnum_t RegNum) { CallerSavedLocalRegsBitmap.set(RegNum); };
void UpdateLocalMaxSSANum(int CurrSSANum) { if (CurrSSANum > MaxLocalSSANum) MaxLocalSSANum = CurrSSANum; };
void AddLeaOperand(STARS_ea_t addr, STARSOpndTypePtr LeaOperand); // add map entry to LeaInstOpMap
void AddNormalizedStackOperand(STARSOpndTypePtr OldOp, STARS_ea_t InstAddr, STARSOpndTypePtr NormalizedOp); // add to map for RTL lookup later
void AddNormalizedStackOperand(STARSOpndTypePtr OldOp, STARS_ea_t InstAddr, STARSOpndTypePtr NormalizedOp, bool DEFFlag); // add to map for RTL lookup later
void UpdateMaxDirectStackAccessOffset(STARS_sval_t NewOffset); // Update MaxDirectStackAccessDelta
void MarkTaintInArgReg(std::size_t ArgPos) { TaintInArgPosBits |= (1 << ArgPos); };
void SetControlFlowType(STARS_ea_t InstAddr, ControlFlowType JumpTypeCode); // insert into ControlFlowMap
......@@ -955,9 +955,12 @@ private:
std::set<std::pair<STARSOpndTypePtr, std::pair<STARS_ea_t, STARS_sval_t> >, LessStackDeltaCopy> StackPtrCopySet; // triple: operand holding copy, InstAddr where copy is made, stack delta for copy
std::list<std::pair<STARS_ea_t, STARS_sval_t> > TempStackDeltaReachesList; // Used for temporary lookups of particular op_t in StackPtrCopySet.
std::set<STARS_ea_t, LessAddr> TempReachingDefs; // Temporary list of InstAddrs with defs of one op_t that reach a particular InstAddr.
std::map<STARSDefinition, STARSOpndTypePtr, LessDefinition> NormalizedStackOpsMap; // normalized stack operands, indexed by instruction address (for lookup from RTLs).
std::map<STARSDefinition, std::map<STARSDefinition, STARSOpndTypePtr, LessDefinition>::iterator, LessDefinition> InverseNormalizedStackOpsMap; // index: normalized op,
// mapped to: iterator into NormalizedStackOpsMap; only for use in functions that call alloca() and need to re-normalize stack ops repeatedly
std::map<STARSDefinition, STARSOpndTypePtr, LessDefinition> NormalizedStackDEFOpsMap; // normalized stack DEF operands, indexed by instruction address (for lookup from RTLs).
std::map<STARSDefinition, STARSOpndTypePtr, LessDefinition> NormalizedStackUSEOpsMap; // normalized stack USE operands, indexed by instruction address (for lookup from RTLs).
std::map<STARSDefinition, std::map<STARSDefinition, STARSOpndTypePtr, LessDefinition>::iterator, LessDefinition> InverseNormalizedStackDEFOpsMap; // index: normalized op,
// mapped to: iterator into NormalizedStackDEFOpsMap; only for use in functions that call alloca() and need to re-normalize stack ops repeatedly
std::map<STARSDefinition, std::map<STARSDefinition, STARSOpndTypePtr, LessDefinition>::iterator, LessDefinition> InverseNormalizedStackUSEOpsMap; // index: normalized op,
// mapped to: iterator into NormalizedStackUSEOpsMap; only for use in functions that call alloca() and need to re-normalize stack ops repeatedly
std::bitset<1 + MD_LAST_REG_NO> PreservedRegsBitmap; // Registers that are saved on entry and restored before return from func, or never used, as a bitmap.
std::bitset<1 + MD_LAST_REG_NO> CallerSavedLocalRegsBitmap; // Reg numbers that are local names and are caller-saved
std::bitset<1 + MD_LAST_REG_NO> MemRangeRegsBitmap; // Reg numbers that are used in defining the memory writing range expr
......@@ -1072,7 +1075,7 @@ private:
void FindDependentInductionVar(std::size_t LoopIndex, struct DependentInductionVar &DIV, STARSOpndTypePtr Add1, STARSOpndTypePtr Add2, STARSOpndTypePtr Mult1, STARSOpndTypePtr Mult2, SMPoperator RhsOperator, SMPInstr *DefInst); // pass in results of DefInst::IsDependentInductionVarArithmetic()
bool ReplaceLoopRegWithConst(std::size_t LoopIndex, STARSOpndTypePtr &RegOp, SMPInstr *UseInst); // If RegOp USE in UseInst is an SCCP constant, create an immediate operand for it.
void AddEdgeExpression(const int SourceBlockNum, const int TargetBlockNum, const struct LoopComparison GuardExpr); // Add to EdgeExpressions vector and map
void AddEdgeExpression(const int SourceBlockNum, const int TargetBlockNum, const struct LoopComparison &GuardExpr); // Add to EdgeExpressions vector and map
void ComputeInArgConstValues(void); // Fill InArgConstValues with SCCP values from call sites.
STARSExpression *CreateLimitExpr(const std::size_t &LoopIndex, const struct InductionVarFamily &IVFamily, const struct LoopComparison &LoopCompExpr); // Create loop limit expr: BIVOpnd relationaloperator Opnd2
......
This diff is collapsed.
This diff is collapsed.
Subproject commit 8dc3b9ad64d39d25ef7f3fb0dbd4a2a48356f2bd
Subproject commit 66dc48d9324fa2634848aa3eff78880339b94401
OBJS=SMPDataFlowAnalysis.o SMPInstr.o SMPBasicBlock.o \
SMPFunction.o SMPProgram.o SMPDBInterface.o ProfilerInformation.o
OBJS=SMPDataFlowAnalysis.o SMPRTL.o SMPInstr.o SMPInstrSPARK.o SMPBasicBlock.o SMPBasicBlockSPARK.o \
SMPFunction.o SMPFunctionSPARK.o SMPProgram.o SMPDBInterface.o ProfilerInformation.o
CXX=@CXX@
LD=@LD@
EXTRA_CXXFLAGS=@EXTRA_CXXFLAGS@
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include <list>
#include <cstdint>
#include <interfaces/idapro/all.h>
......