Commit 91a72528 authored by dcw's avatar dcw

Defines -> ManyShapes

also rearranged comment descriptions of meaning of optimizations
(now tagfield clearly implies manyshapes)
parent ce16b401
......@@ -38,7 +38,7 @@ void optimize( d ) declnlist d;
optimize_decln( d );
} else
{
d->Defines = d->TagField = d->Struct = d->Union = TRUE;
d->ManyShapes = d->TagField = d->Struct = d->Union = TRUE;
d->UseNull = d->PutLoop = FALSE;
}
}
......@@ -60,13 +60,13 @@ static void optimize_decln( d ) decln d;
t = e+ne;
/*
Need Defines when: ">1 shape"
Need Struct when: "some data to be stored"
Need TagField when: "struct && (union or >2 shapes)"
Need Union when: ">1 chunks of data to be stored"
Can UseNull when: "firstempty and some data elsewhere"
ManyShapes when: ">1 shape"
Struct when: ">0 chunks of data to be stored"
TagField when: ">1 chunks or (>0 chunks && >2 shapes)"
Union when: ">1 chunks of data to be stored"
UseNull when: "firstempty and some data elsewhere"
*/
d->Defines = t>1;
d->ManyShapes = t>1;
d->Struct = ne>0;
d->TagField = ne>1 || ( ne>0 && t>2);
d->Union = ne>1;
......@@ -77,8 +77,8 @@ static void optimize_decln( d ) decln d;
if( verbose )
{
#define XXX(x) ( (x)?' ':'!')
printf( "type %s: %cDefines, %cTagField, ",
d->name, XXX(d->Defines),
printf( "type %s: %cManyShapes, %cTagField, ",
d->name, XXX(d->ManyShapes),
XXX(d->TagField) );
printf( "%cStruct, %cUnion, %cUseNull\n",
XXX(d->Struct), XXX(d->Union),
......@@ -92,10 +92,8 @@ static void optimize_decln( d ) decln d;
("optimizer error: type %s has TagField&!Struct\n",d->name) );
ASSERT( implies(d->UseNull,d->Struct),
("optimizer error: type %s has UseNull&!Struct\n",d->name) );
ASSERT( implies(d->TagField,d->Defines),
("optimizer error: type %s has TagField&!Defines\n",d->name) );
/******* Not sure about this one.. Want it, but can't prove it! ******/
ASSERT( implies(d->TagField,d->ManyShapes),
("optimizer error: type %s has TagField&!ManyShapes\n",d->name) );
ASSERT( implies(d->Union,d->TagField),
("optimizer error: type %s has Union&!TagField\n",d->name) );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment