ir3: Add ir3_trim_constlen()
[mesa.git] / src / freedreno / ir3 / ir3.c
index 3d41a7b5cc4864cfe52c94d228e1359b3e853ceb..8b34418828c0ca5a98cccd1ad59af122ca041c47 100644 (file)
@@ -35,7 +35,7 @@
 #include "util/u_math.h"
 
 #include "instr-a3xx.h"
-#include "ir3_compiler.h"
+#include "ir3_shader.h"
 
 /* simple allocator to carve allocations out of an up-front allocated heap,
  * so that we can free everything easily in one shot.
@@ -48,7 +48,7 @@ void * ir3_alloc(struct ir3 *shader, int sz)
 struct ir3 * ir3_create(struct ir3_compiler *compiler,
                struct ir3_shader_variant *v)
 {
-       struct ir3 *shader = rzalloc(NULL, struct ir3);
+       struct ir3 *shader = rzalloc(v, struct ir3);
 
        shader->compiler = compiler;
        shader->type = v->type;
@@ -944,7 +944,7 @@ void * ir3_assemble(struct ir3_shader_variant *v)
                info->sizedwords = align(info->sizedwords, 4 * 2);
        }
 
-       ptr = dwords = calloc(4, info->sizedwords);
+       ptr = dwords = rzalloc_size(v, 4 * info->sizedwords);
 
        foreach_block (block, &shader->block_list) {
                unsigned sfu_delay = 0;