gpu-compute: Fix register checking and allocation in dyn manager
gpu-compute: Fix register checking and allocation in dyn manager

This patch updates the canAllocate function to account both for
the number of regions of registers that need to be allocated,
and for the fact that the registers aren't one continuous chunk.

The patch also consolidates the registers as much as possible when
a register chunk is freed. This prevents fragmentation from making
it impossible to allocate enough registers

Change-Id: Ic95cfe614d247add475f7139d3703991042f8149
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56909
Reviewed-by: Matt Sinclair <d2406197fb1bedd1e23c70c50c510ff0e9ab0f5b@gmail.com>
Maintainer: Matt Sinclair <d2406197fb1bedd1e23c70c50c510ff0e9ab0f5b@gmail.com>
Tested-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Reviewed-by: Matthew Poremba <f1eb50f3368ce197c52b19f7fdb5aa7a278f15fd@amd.com>

gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5