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:
committed by
Marge Bot
parent
a369800822
commit
4bedd8c35c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user