mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
pan/bi: bail from optimizing on oom
Allocations can fail, and since this is an optimization pass, let's just
skip the pass and let some other code deal with the OOM situation.
Fixes: 800a861431 ("pan/bi: Fuse FCMP/ICMP on Valhall")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
This commit is contained in:
parent
a369800822
commit
4bedd8c35c
1 changed files with 4 additions and 0 deletions
|
|
@ -306,6 +306,9 @@ va_optimize_forward(bi_context *ctx)
|
|||
bi_instr **uses = calloc(count, sizeof(*uses));
|
||||
BITSET_WORD *multiple = calloc(BITSET_WORDS(count), sizeof(*multiple));
|
||||
|
||||
if (!lut || !uses || !multiple)
|
||||
goto out;
|
||||
|
||||
/* Record usage across blocks */
|
||||
bi_foreach_block(ctx, block) {
|
||||
bi_foreach_instr_in_block(block, I) {
|
||||
|
|
@ -323,6 +326,7 @@ va_optimize_forward(bi_context *ctx)
|
|||
va_fuse_cmp(ctx, lut, multiple, I);
|
||||
}
|
||||
|
||||
out:
|
||||
free(uses);
|
||||
free(lut);
|
||||
free(multiple);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue