When running Rust benchmarks on O0 (emitted IR contains many short functions) I measured a significant performance impact caused by allocations of the newly introduced uniques regions. I identified two major factors which should be addressed by this PR:
Alignment and size of the uniques regions are not final or compilation final
Allocation of empty uniques regions
Resolving unique slots to pointers is already a bit faster compared to allocations via alloca. I don't know if the fact that pointers to unique slots stay valid until the current frame is closed could be exploited to improve the performance further (it would be enough to resolve unique slots once per active stack frame).
When running Rust benchmarks on O0 (emitted IR contains many short functions) I measured a significant performance impact caused by allocations of the newly introduced uniques regions. I identified two major factors which should be addressed by this PR:
Resolving unique slots to pointers is already a bit faster compared to allocations via
alloca
. I don't know if the fact that pointers to unique slots stay valid until the current frame is closed could be exploited to improve the performance further (it would be enough to resolve unique slots once per active stack frame).