1 /*-------------------------------------------------------------------------
3 SDCCcse.h - header file for Common Subexpressions
5 Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 In other words, you are welcome to use, share and improve this program.
22 You are forbidden to forbid anyone else to use, share and improve
23 what you give them. Help stamp out software-hoarding!
24 -------------------------------------------------------------------------*/
26 #include "SDCCicode.h"
35 operand
*sym
; /* defining symbol */
36 iCode
*diCode
; /* defining instruction */
37 bitVect
*ancestors
; /* keys of the symbol's ancestors */
38 int fromGlobal
; /* defining symbol's value computed from a global */
39 unsigned fromAddrTaken
:1; /* defining symbol's value computed from a */
40 /* symbol whose address was taken */
41 unsigned nonLocalCSE
:1; /* CSE def visible outside of originating */
47 cseDef
*newCseDef (operand
*, iCode
*);
48 int isCseDefEqual (void *, void *);
49 int pcseDef (void *, va_list);
50 DEFSETFUNC (ifDiCodeIsX
);
51 int ifDiCodeIs (set
*, iCode
*);
52 DEFSETFUNC (ifDefSymIsX
);
53 int ifDefSymIs (set
*, operand
*);
54 DEFSETFUNC (findPrevIc
);
55 DEFSETFUNC (ifOperandsHave
);
56 DEFSETFUNC (findCheaperOp
);
57 int cseBBlock (eBBlock
*, int computeOnly
, ebbIndex
*);
58 int cseAllBlocks (ebbIndex
*, int computeOnly
);
59 void unsetDefsAndUses (iCode
*);
60 void updateSpillLocation (iCode
* ic
,int);
61 void setUsesDefs (operand
*, bitVect
*, bitVect
*, bitVect
**);
62 void replaceAllSymBySym (iCode
*, operand
*, operand
*, bitVect
**);
63 iCode
*findBackwardDef(operand
*,iCode
*);
64 void ReplaceOpWithCheaperOp(operand
**op
, operand
*cop
);
65 void freeCSEdata (eBBlock
*);