mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-4979 Better support for partial array optimizations
This commit is contained in:
parent
43655ab76c
commit
784540f1c0
14 changed files with 317 additions and 134 deletions
|
@ -488,6 +488,8 @@ public:
|
|||
Varnode *opStackLoad(AddrSpace *spc,uintb off,uint4 sz,PcodeOp *op,Varnode *stackptr,bool insertafter);
|
||||
PcodeOp *opStackStore(AddrSpace *spc,uintb off,PcodeOp *op,bool insertafter);
|
||||
void opUndoPtradd(PcodeOp *op,bool finalize); ///< Convert a CPUI_PTRADD back into a CPUI_INT_ADD
|
||||
static int4 opFlipInPlaceTest(PcodeOp *op,vector<PcodeOp *> &fliplist);
|
||||
void opFlipInPlaceExecute(vector<PcodeOp *> &fliplist);
|
||||
|
||||
/// \brief Start of PcodeOp objects with the given op-code
|
||||
list<PcodeOp *>::const_iterator beginOp(OpCode opc) const { return obank.begin(opc); }
|
||||
|
@ -563,6 +565,11 @@ public:
|
|||
bool replaceLessequal(PcodeOp *op); ///< Replace INT_LESSEQUAL and INT_SLESSEQUAL expressions
|
||||
bool distributeIntMultAdd(PcodeOp *op); ///< Distribute constant coefficient to additive input
|
||||
bool collapseIntMultMult(Varnode *vn); ///< Collapse constant coefficients for two chained CPUI_INT_MULT
|
||||
Varnode *buildCopyTemp(Varnode *vn,PcodeOp *point); ///< Create a COPY of given Varnode in a temporary register
|
||||
|
||||
static PcodeOp *cseFindInBlock(PcodeOp *op,Varnode *vn,BlockBasic *bl,PcodeOp *earliest);
|
||||
PcodeOp *cseElimination(PcodeOp *op1,PcodeOp *op2);
|
||||
void cseEliminateList(vector< pair<uintm,PcodeOp *> > &list,vector<Varnode *> &outlist);
|
||||
static bool compareCallspecs(const FuncCallSpecs *a,const FuncCallSpecs *b);
|
||||
|
||||
#ifdef OPACTION_DEBUG
|
||||
|
@ -688,14 +695,5 @@ public:
|
|||
bool execute(PcodeOp *op,int4 slot,ParamTrial *t,bool allowFail);
|
||||
};
|
||||
|
||||
extern int4 opFlipInPlaceTest(PcodeOp *op,vector<PcodeOp *> &fliplist);
|
||||
extern void opFlipInPlaceExecute(Funcdata &data,vector<PcodeOp *> &fliplist);
|
||||
|
||||
extern PcodeOp *earliestUseInBlock(Varnode *vn,BlockBasic *bl);
|
||||
extern PcodeOp *cseFindInBlock(PcodeOp *op,Varnode *vn,BlockBasic *bl,PcodeOp *earliest);
|
||||
extern PcodeOp *cseElimination(Funcdata &data,PcodeOp *op1,PcodeOp *op2);
|
||||
extern void cseEliminateList(Funcdata &data,vector< pair<uintm,PcodeOp *> > &list,
|
||||
vector<Varnode *> &outlist);
|
||||
|
||||
} // End namespace ghidra
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue