diff options
| -rw-r--r-- | backend/src/backend/gen_reg_allocation.cpp | 2 | ||||
| -rw-r--r-- | backend/src/ir/instruction.cpp | 1 | ||||
| -rw-r--r-- | backend/src/sys/alloc.hpp | 17 |
3 files changed, 11 insertions, 9 deletions
diff --git a/backend/src/backend/gen_reg_allocation.cpp b/backend/src/backend/gen_reg_allocation.cpp index 0574fbf2..6eec732c 100644 --- a/backend/src/backend/gen_reg_allocation.cpp +++ b/backend/src/backend/gen_reg_allocation.cpp @@ -486,7 +486,7 @@ namespace gbe // Allocate all the vectors first since they need to be contiguous this->allocateVector(selection); - schedulePreRegAllocation(ctx, selection); + //schedulePreRegAllocation(ctx, selection); // Now start the linear scan allocation for (uint32_t regID = 0; regID < ctx.sel->getRegNum(); ++regID) diff --git a/backend/src/ir/instruction.cpp b/backend/src/ir/instruction.cpp index a2a6a510..77099515 100644 --- a/backend/src/ir/instruction.cpp +++ b/backend/src/ir/instruction.cpp @@ -1087,6 +1087,7 @@ namespace ir { case MEM_LOCAL: return out << "local"; case MEM_CONSTANT: return out << "constant"; case MEM_PRIVATE: return out << "private"; + case MEM_INVALID: NOT_SUPPORTED; return out; }; return out; } diff --git a/backend/src/sys/alloc.hpp b/backend/src/sys/alloc.hpp index cec406e6..29208fec 100644 --- a/backend/src/sys/alloc.hpp +++ b/backend/src/sys/alloc.hpp @@ -195,12 +195,8 @@ namespace gbe this->full = this->curr; // Try to pick up a free block - if (this->free) { - GBE_ASSERT(this->free->allocated < this->free->maxElemNum); - this->curr = this->free; - this->free = this->free->next; - this->curr->next = NULL; - } + if (this->free) this->getFreeBlock(); + // No free block we must allocate a new one else this->curr = GBE_NEW(GrowingPoolElem, 2 * this->curr->maxElemNum); @@ -238,14 +234,19 @@ namespace gbe this->free = this->full; this->full = next; } + // Provide a valid current block + this->getFreeBlock(); +#endif /* GBE_DEBUG_SPECIAL_ALLOCATOR */ + } + private: + /*! Pick-up a free block */ + INLINE void getFreeBlock(void) { GBE_ASSERT(this->free); this->curr = this->free; this->free = this->free->next; this->curr->next = NULL; -#endif /* GBE_DEBUG_SPECIAL_ALLOCATOR */ } - private: /*! Chunk of elements to allocate */ class GrowingPoolElem { |
