/* checkRegsMask - check the consistancy of the regMask redundancy */
/*-----------------------------------------------------------------*/
-void checkRegMask(char *f) { // for debugging purposes only
+void checkRegMask(const char *f) { // for debugging purposes only
int i;
unsigned long regMask=0;
/* allocReg - allocates register of given size (byte, word, dword) */
/* and type (ptr, gpr, cnd) */
/*-----------------------------------------------------------------*/
-static bool allocReg (short size, short type, symbol *sym,
- short offset, bool silent) {
+static bool allocReg (unsigned int size, int type, symbol *sym,
+ int offset, bool silent) {
int i;
checkRegMask(__FUNCTION__);
bitVect *spillable;
int willCS;
- /* if it does not need or is spilt
+ /* Make sure any spill location is definately allocated */
+ if (sym->isspilt && !sym->remat && sym->usl.spillLoc &&
+ !sym->usl.spillLoc->allocreq) {
+ sym->usl.spillLoc->allocreq++;
+ }
+
+ /* if it does not need or is spilt
or is already assigned to registers
or will not live beyond this instructions */
if (!sym->nRegs ||
return change;
}
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
/*-----------------------------------------------------------------*/
/* packRegsForOneuse : - will reduce some registers for single Use */
/* assignRegisters - assigns registers to each live range as need */
/*-----------------------------------------------------------------*/
void
-xa51_assignRegisters (eBBlock ** ebbs, int count)
+xa51_assignRegisters (ebbIndex * ebbi)
{
+ eBBlock ** ebbs = ebbi->bbOrder;
+ int count = ebbi->count;
iCode *ic;
int i;
recomputeLiveRanges (ebbs, count);
if (options.dump_pack)
- dumpEbbsToFileExt (DUMP_PACK, ebbs, count);
+ dumpEbbsToFileExt (DUMP_PACK, ebbi);
/* first determine for each live range the number of
registers & the type of registers required for each */
if (options.dump_rassgn)
{
- dumpEbbsToFileExt (DUMP_RASSGN, ebbs, count);
+ dumpEbbsToFileExt (DUMP_RASSGN, ebbi);
dumpLiveRanges (DUMP_LRANGE, liveRanges);
}