static int copyau1(Prog *p, Adr *v);
static int isdconst(Addr *a);
+static uint32 gactive;
+
// UNUSED
int shiftprop(Flow *r);
void constprop(Adr *c1, Adr *v1, Flow *r);
g = flowstart(firstp, sizeof(Flow));
if(g == nil)
return;
+ gactive = 0;
loop1:
if(debug['P'] && debug['v'])
{
Prog *p;
Adr *v1, *v2;
- Flow *r;
+ USED(g);
p = r0->prog;
v1 = &p->from;
v2 = &p->to;
if(copyas(v1, v2))
return 1;
- for(r=g->start; r!=nil; r=r->link)
- r->active = 0;
+ gactive++;
return copy1(v1, v2, r0->s1, 0);
}
int t;
Prog *p;
- if(r->active) {
+ if(r->active == gactive) {
if(debug['P'])
print("act set; return 1\n");
return 1;
}
- r->active = 1;
+ r->active = gactive;
if(debug['P'])
print("copy %D->%D f=%d\n", v1, v2, f);
for(; r != nil; r = r->s1) {
static int copyau(Adr*, Adr*);
static int copysub(Adr*, Adr*, Adr*, int);
+static uint32 gactive;
+
// do we need the carry bit
static int
needc(Prog *p)
g = flowstart(firstp, sizeof(Flow));
if(g == nil)
return;
+ gactive = 0;
// byte, word arithmetic elimination.
elimshortmov(g);
{
Prog *p;
Adr *v1, *v2;
- Flow *r;
+ USED(g);
if(debug['P'] && debug['v'])
print("copyprop %P\n", r0->prog);
p = r0->prog;
v2 = &p->to;
if(copyas(v1, v2))
return 1;
- for(r=g->start; r!=nil; r=r->link)
- r->active = 0;
+ gactive++;
return copy1(v1, v2, r0->s1, 0);
}
int t;
Prog *p;
- if(r->active) {
+ if(r->active == gactive) {
if(debug['P'])
print("act set; return 1\n");
return 1;
}
- r->active = 1;
+ r->active = gactive;
if(debug['P'])
print("copy %D->%D f=%d\n", v1, v2, f);
for(; r != nil; r = r->s1) {
static int copyau(Adr*, Adr*);
static int copysub(Adr*, Adr*, Adr*, int);
+static uint32 gactive;
+
// do we need the carry bit
static int
needc(Prog *p)
g = flowstart(firstp, sizeof(Flow));
if(g == nil)
return;
+ gactive = 0;
// byte, word arithmetic elimination.
elimshortmov(g);
{
Prog *p;
Adr *v1, *v2;
- Flow *r;
+ USED(g);
p = r0->prog;
v1 = &p->from;
v2 = &p->to;
if(copyas(v1, v2))
return 1;
- for(r=g->start; r!=nil; r=r->link)
- r->active = 0;
+ gactive++;
return copy1(v1, v2, r0->s1, 0);
}
int t;
Prog *p;
- if(r->active) {
+ if(r->active == gactive) {
if(debug['P'])
print("act set; return 1\n");
return 1;
}
- r->active = 1;
+ r->active = gactive;
if(debug['P'])
print("copy %D->%D f=%d\n", v1, v2, f);
for(; r != nil; r = r->s1) {