2014-06-26 23:07:39 +01:00
|
|
|
/*
|
|
|
|
* Copyright © 2014 Broadcom
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
* Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
|
* IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "util/u_memory.h"
|
|
|
|
#include "util/u_simple_list.h"
|
2014-09-15 20:15:02 +01:00
|
|
|
#include "util/ralloc.h"
|
2014-06-26 23:07:39 +01:00
|
|
|
|
|
|
|
#include "vc4_qir.h"
|
|
|
|
#include "vc4_qpu.h"
|
|
|
|
|
|
|
|
struct qir_op_info {
|
|
|
|
const char *name;
|
|
|
|
uint8_t ndst, nsrc;
|
2014-07-04 17:48:23 +01:00
|
|
|
bool has_side_effects;
|
2014-06-26 23:07:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct qir_op_info qir_op_info[] = {
|
|
|
|
[QOP_MOV] = { "mov", 1, 1 },
|
|
|
|
[QOP_FADD] = { "fadd", 1, 2 },
|
|
|
|
[QOP_FSUB] = { "fsub", 1, 2 },
|
|
|
|
[QOP_FMUL] = { "fmul", 1, 2 },
|
2014-08-24 22:05:37 +01:00
|
|
|
[QOP_MUL24] = { "mul24", 1, 2 },
|
2014-06-26 23:07:39 +01:00
|
|
|
[QOP_FMIN] = { "fmin", 1, 2 },
|
|
|
|
[QOP_FMAX] = { "fmax", 1, 2 },
|
|
|
|
[QOP_FMINABS] = { "fminabs", 1, 2 },
|
|
|
|
[QOP_FMAXABS] = { "fmaxabs", 1, 2 },
|
2014-08-24 22:05:37 +01:00
|
|
|
[QOP_FTOI] = { "ftoi", 1, 1 },
|
|
|
|
[QOP_ITOF] = { "itof", 1, 1 },
|
|
|
|
[QOP_ADD] = { "add", 1, 2 },
|
|
|
|
[QOP_SUB] = { "sub", 1, 2 },
|
|
|
|
[QOP_SHR] = { "shr", 1, 2 },
|
|
|
|
[QOP_ASR] = { "asr", 1, 2 },
|
|
|
|
[QOP_SHL] = { "shl", 1, 2 },
|
|
|
|
[QOP_MIN] = { "min", 1, 2 },
|
|
|
|
[QOP_MAX] = { "max", 1, 2 },
|
|
|
|
[QOP_AND] = { "and", 1, 2 },
|
|
|
|
[QOP_OR] = { "or", 1, 2 },
|
|
|
|
[QOP_XOR] = { "xor", 1, 2 },
|
|
|
|
[QOP_NOT] = { "not", 1, 1 },
|
2014-06-28 17:26:15 +01:00
|
|
|
|
2014-08-25 00:51:32 +01:00
|
|
|
[QOP_SF] = { "sf", 0, 1 },
|
|
|
|
[QOP_SEL_X_0_NS] = { "fsel_x_0_ns", 1, 1 },
|
|
|
|
[QOP_SEL_X_0_NC] = { "fsel_x_0_nc", 1, 1 },
|
|
|
|
[QOP_SEL_X_0_ZS] = { "fsel_x_0_zs", 1, 1 },
|
|
|
|
[QOP_SEL_X_0_ZC] = { "fsel_x_0_zc", 1, 1 },
|
|
|
|
[QOP_SEL_X_Y_NS] = { "fsel_x_y_ns", 1, 2 },
|
|
|
|
[QOP_SEL_X_Y_NC] = { "fsel_x_y_nc", 1, 2 },
|
|
|
|
[QOP_SEL_X_Y_ZS] = { "fsel_x_y_zs", 1, 2 },
|
|
|
|
[QOP_SEL_X_Y_ZC] = { "fsel_x_y_zc", 1, 2 },
|
2014-06-28 17:26:15 +01:00
|
|
|
|
2014-06-26 23:07:39 +01:00
|
|
|
[QOP_RCP] = { "rcp", 1, 1 },
|
|
|
|
[QOP_RSQ] = { "rsq", 1, 1 },
|
|
|
|
[QOP_EXP2] = { "exp2", 1, 2 },
|
|
|
|
[QOP_LOG2] = { "log2", 1, 2 },
|
|
|
|
[QOP_PACK_COLORS] = { "pack_colors", 1, 4 },
|
|
|
|
[QOP_PACK_SCALED] = { "pack_scaled", 1, 2 },
|
2014-07-04 17:48:23 +01:00
|
|
|
[QOP_VPM_WRITE] = { "vpm_write", 0, 1, true },
|
|
|
|
[QOP_VPM_READ] = { "vpm_read", 0, 1, true },
|
2014-08-21 21:12:19 +01:00
|
|
|
[QOP_TLB_DISCARD_SETUP] = { "discard", 0, 1, true },
|
2014-09-18 20:22:07 +01:00
|
|
|
[QOP_TLB_STENCIL_SETUP] = { "tlb_stencil_setup", 0, 1, true },
|
2014-09-16 19:20:52 +01:00
|
|
|
[QOP_TLB_Z_WRITE] = { "tlb_z", 0, 1, true },
|
2014-07-04 17:48:23 +01:00
|
|
|
[QOP_TLB_COLOR_WRITE] = { "tlb_color", 0, 1, true },
|
2014-12-02 20:58:27 +00:00
|
|
|
[QOP_TLB_COLOR_READ] = { "tlb_color_read", 1, 0 },
|
2014-07-04 17:38:44 +01:00
|
|
|
[QOP_VARY_ADD_C] = { "vary_add_c", 1, 1 },
|
2014-07-15 20:29:32 +01:00
|
|
|
|
2014-08-05 22:24:29 +01:00
|
|
|
[QOP_FRAG_X] = { "frag_x", 1, 0 },
|
|
|
|
[QOP_FRAG_Y] = { "frag_y", 1, 0 },
|
|
|
|
[QOP_FRAG_Z] = { "frag_z", 1, 0 },
|
2014-09-19 18:06:49 +01:00
|
|
|
[QOP_FRAG_W] = { "frag_w", 1, 0 },
|
2014-10-01 00:08:23 +01:00
|
|
|
[QOP_FRAG_REV_FLAG] = { "frag_rev_flag", 1, 0 },
|
2014-08-05 22:24:29 +01:00
|
|
|
|
2014-07-15 20:29:32 +01:00
|
|
|
[QOP_TEX_S] = { "tex_s", 0, 2 },
|
|
|
|
[QOP_TEX_T] = { "tex_t", 0, 2 },
|
|
|
|
[QOP_TEX_R] = { "tex_r", 0, 2 },
|
|
|
|
[QOP_TEX_B] = { "tex_b", 0, 2 },
|
2014-10-02 02:27:24 +01:00
|
|
|
[QOP_TEX_DIRECT] = { "tex_direct", 0, 2 },
|
2014-09-07 22:04:40 +01:00
|
|
|
[QOP_TEX_RESULT] = { "tex_result", 1, 0, true },
|
|
|
|
[QOP_R4_UNPACK_A] = { "r4_unpack_a", 1, 1 },
|
|
|
|
[QOP_R4_UNPACK_B] = { "r4_unpack_b", 1, 1 },
|
|
|
|
[QOP_R4_UNPACK_C] = { "r4_unpack_c", 1, 1 },
|
|
|
|
[QOP_R4_UNPACK_D] = { "r4_unpack_d", 1, 1 },
|
2014-12-15 18:45:58 +00:00
|
|
|
[QOP_UNPACK_8A_F] = { "unpack_8a_f", 1, 1 },
|
|
|
|
[QOP_UNPACK_8B_F] = { "unpack_8b_f", 1, 1 },
|
|
|
|
[QOP_UNPACK_8C_F] = { "unpack_8c_f", 1, 1 },
|
|
|
|
[QOP_UNPACK_8D_F] = { "unpack_8d_f", 1, 1 },
|
2014-12-15 20:30:26 +00:00
|
|
|
[QOP_UNPACK_16A_F] = { "unpack_16a_f", 1, 1 },
|
|
|
|
[QOP_UNPACK_16B_F] = { "unpack_16b_f", 1, 1 },
|
2014-12-15 19:19:58 +00:00
|
|
|
[QOP_UNPACK_8A_I] = { "unpack_8a_i", 1, 1 },
|
|
|
|
[QOP_UNPACK_8B_I] = { "unpack_8b_i", 1, 1 },
|
|
|
|
[QOP_UNPACK_8C_I] = { "unpack_8c_i", 1, 1 },
|
|
|
|
[QOP_UNPACK_8D_I] = { "unpack_8d_i", 1, 1 },
|
2014-12-15 20:30:26 +00:00
|
|
|
[QOP_UNPACK_16A_I] = { "unpack_16a_i", 1, 1 },
|
|
|
|
[QOP_UNPACK_16B_I] = { "unpack_16b_i", 1, 1 },
|
2014-06-26 23:07:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
qir_get_op_name(enum qop qop)
|
|
|
|
{
|
|
|
|
if (qop < ARRAY_SIZE(qir_op_info) && qir_op_info[qop].name)
|
|
|
|
return qir_op_info[qop].name;
|
|
|
|
else
|
|
|
|
return "???";
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
qir_get_op_nsrc(enum qop qop)
|
|
|
|
{
|
|
|
|
if (qop < ARRAY_SIZE(qir_op_info) && qir_op_info[qop].name)
|
|
|
|
return qir_op_info[qop].nsrc;
|
|
|
|
else
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
2014-10-24 15:03:04 +01:00
|
|
|
/**
|
|
|
|
* Returns whether the instruction has any side effects that must be
|
|
|
|
* preserved.
|
|
|
|
*/
|
2014-07-04 17:48:23 +01:00
|
|
|
bool
|
2014-10-24 15:03:04 +01:00
|
|
|
qir_has_side_effects(struct vc4_compile *c, struct qinst *inst)
|
2014-07-04 17:48:23 +01:00
|
|
|
{
|
2014-10-24 15:03:04 +01:00
|
|
|
/* We can dead-code eliminate varyings, because we only tell the VS
|
|
|
|
* about the live ones at the end. But we have to preserve the
|
|
|
|
* point/line coordinates reads, because they're generated by
|
|
|
|
* fixed-function hardware.
|
|
|
|
*/
|
2014-07-04 17:48:23 +01:00
|
|
|
for (int i = 0; i < qir_get_op_nsrc(inst->op); i++) {
|
2014-10-24 15:03:04 +01:00
|
|
|
if (inst->src[i].file == QFILE_VARY &&
|
|
|
|
c->input_semantics[inst->src[i].index].semantic == 0xff) {
|
2014-07-04 17:48:23 +01:00
|
|
|
return true;
|
2014-10-24 15:03:04 +01:00
|
|
|
}
|
2014-07-04 17:48:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return qir_op_info[inst->op].has_side_effects;
|
|
|
|
}
|
|
|
|
|
2014-08-25 08:12:21 +01:00
|
|
|
bool
|
|
|
|
qir_depends_on_flags(struct qinst *inst)
|
|
|
|
{
|
|
|
|
switch (inst->op) {
|
|
|
|
case QOP_SEL_X_0_NS:
|
|
|
|
case QOP_SEL_X_0_NC:
|
|
|
|
case QOP_SEL_X_0_ZS:
|
|
|
|
case QOP_SEL_X_0_ZC:
|
|
|
|
case QOP_SEL_X_Y_NS:
|
|
|
|
case QOP_SEL_X_Y_NC:
|
|
|
|
case QOP_SEL_X_Y_ZS:
|
|
|
|
case QOP_SEL_X_Y_ZC:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
qir_writes_r4(struct qinst *inst)
|
|
|
|
{
|
|
|
|
switch (inst->op) {
|
|
|
|
case QOP_TEX_RESULT:
|
|
|
|
case QOP_TLB_COLOR_READ:
|
|
|
|
case QOP_RCP:
|
|
|
|
case QOP_RSQ:
|
|
|
|
case QOP_EXP2:
|
|
|
|
case QOP_LOG2:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
qir_reads_r4(struct qinst *inst)
|
|
|
|
{
|
|
|
|
switch (inst->op) {
|
|
|
|
case QOP_R4_UNPACK_A:
|
|
|
|
case QOP_R4_UNPACK_B:
|
|
|
|
case QOP_R4_UNPACK_C:
|
|
|
|
case QOP_R4_UNPACK_D:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-26 23:07:39 +01:00
|
|
|
static void
|
2014-09-25 06:03:06 +01:00
|
|
|
qir_print_reg(struct vc4_compile *c, struct qreg reg)
|
2014-06-26 23:07:39 +01:00
|
|
|
{
|
2014-12-10 22:56:46 +00:00
|
|
|
static const char *files[] = {
|
2014-06-26 23:07:39 +01:00
|
|
|
[QFILE_TEMP] = "t",
|
|
|
|
[QFILE_VARY] = "v",
|
|
|
|
[QFILE_UNIF] = "u",
|
|
|
|
};
|
|
|
|
|
2014-12-10 22:56:46 +00:00
|
|
|
if (reg.file == QFILE_NULL) {
|
2014-06-26 23:07:39 +01:00
|
|
|
fprintf(stderr, "null");
|
2014-12-10 22:56:46 +00:00
|
|
|
} else if (reg.file == QFILE_SMALL_IMM) {
|
|
|
|
if ((int)reg.index >= -16 && (int)reg.index <= 15)
|
|
|
|
fprintf(stderr, "%d", reg.index);
|
|
|
|
else
|
|
|
|
fprintf(stderr, "%f", uif(reg.index));
|
|
|
|
} else {
|
2014-06-26 23:07:39 +01:00
|
|
|
fprintf(stderr, "%s%d", files[reg.file], reg.index);
|
2014-12-10 22:56:46 +00:00
|
|
|
}
|
2014-09-25 06:03:06 +01:00
|
|
|
|
|
|
|
if (reg.file == QFILE_UNIF &&
|
|
|
|
c->uniform_contents[reg.index] == QUNIFORM_CONSTANT) {
|
|
|
|
fprintf(stderr, " (0x%08x / %f)",
|
|
|
|
c->uniform_data[reg.index],
|
|
|
|
uif(c->uniform_data[reg.index]));
|
|
|
|
}
|
2014-06-26 23:07:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-09-25 06:03:06 +01:00
|
|
|
qir_dump_inst(struct vc4_compile *c, struct qinst *inst)
|
2014-06-26 23:07:39 +01:00
|
|
|
{
|
|
|
|
fprintf(stderr, "%s ", qir_get_op_name(inst->op));
|
|
|
|
|
2014-09-25 06:03:06 +01:00
|
|
|
qir_print_reg(c, inst->dst);
|
2014-06-26 23:07:39 +01:00
|
|
|
for (int i = 0; i < qir_get_op_nsrc(inst->op); i++) {
|
|
|
|
fprintf(stderr, ", ");
|
2014-09-25 06:03:06 +01:00
|
|
|
qir_print_reg(c, inst->src[i]);
|
2014-06-26 23:07:39 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-08-13 21:41:22 +01:00
|
|
|
qir_dump(struct vc4_compile *c)
|
2014-06-26 23:07:39 +01:00
|
|
|
{
|
|
|
|
struct simple_node *node;
|
|
|
|
|
|
|
|
foreach(node, &c->instructions) {
|
|
|
|
struct qinst *inst = (struct qinst *)node;
|
2014-09-25 06:03:06 +01:00
|
|
|
qir_dump_inst(c, inst);
|
2014-06-26 23:07:39 +01:00
|
|
|
fprintf(stderr, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct qreg
|
2014-08-13 21:41:22 +01:00
|
|
|
qir_get_temp(struct vc4_compile *c)
|
2014-06-26 23:07:39 +01:00
|
|
|
{
|
|
|
|
struct qreg reg;
|
|
|
|
|
|
|
|
reg.file = QFILE_TEMP;
|
|
|
|
reg.index = c->num_temps++;
|
|
|
|
|
|
|
|
return reg;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct qinst *
|
|
|
|
qir_inst(enum qop op, struct qreg dst, struct qreg src0, struct qreg src1)
|
|
|
|
{
|
|
|
|
struct qinst *inst = CALLOC_STRUCT(qinst);
|
|
|
|
|
|
|
|
inst->op = op;
|
|
|
|
inst->dst = dst;
|
|
|
|
inst->src = calloc(2, sizeof(inst->src[0]));
|
|
|
|
inst->src[0] = src0;
|
|
|
|
inst->src[1] = src1;
|
|
|
|
|
|
|
|
return inst;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct qinst *
|
|
|
|
qir_inst4(enum qop op, struct qreg dst,
|
|
|
|
struct qreg a,
|
|
|
|
struct qreg b,
|
|
|
|
struct qreg c,
|
|
|
|
struct qreg d)
|
|
|
|
{
|
|
|
|
struct qinst *inst = CALLOC_STRUCT(qinst);
|
|
|
|
|
|
|
|
inst->op = op;
|
|
|
|
inst->dst = dst;
|
|
|
|
inst->src = calloc(4, sizeof(*inst->src));
|
|
|
|
inst->src[0] = a;
|
|
|
|
inst->src[1] = b;
|
|
|
|
inst->src[2] = c;
|
|
|
|
inst->src[3] = d;
|
|
|
|
|
|
|
|
return inst;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-08-13 21:41:22 +01:00
|
|
|
qir_emit(struct vc4_compile *c, struct qinst *inst)
|
2014-06-26 23:07:39 +01:00
|
|
|
{
|
|
|
|
insert_at_tail(&c->instructions, &inst->link);
|
|
|
|
}
|
|
|
|
|
2014-07-03 21:18:49 +01:00
|
|
|
bool
|
|
|
|
qir_reg_equals(struct qreg a, struct qreg b)
|
|
|
|
{
|
|
|
|
return a.file == b.file && a.index == b.index;
|
|
|
|
}
|
|
|
|
|
2014-08-13 21:41:22 +01:00
|
|
|
struct vc4_compile *
|
2014-06-26 23:07:39 +01:00
|
|
|
qir_compile_init(void)
|
|
|
|
{
|
2014-09-15 20:15:02 +01:00
|
|
|
struct vc4_compile *c = rzalloc(NULL, struct vc4_compile);
|
2014-06-26 23:07:39 +01:00
|
|
|
|
|
|
|
make_empty_list(&c->instructions);
|
|
|
|
|
2014-09-16 20:55:16 +01:00
|
|
|
c->output_position_index = -1;
|
2014-10-15 15:25:57 +01:00
|
|
|
c->output_clipvertex_index = -1;
|
2014-09-16 20:55:16 +01:00
|
|
|
c->output_color_index = -1;
|
2014-10-15 15:25:57 +01:00
|
|
|
c->output_point_size_index = -1;
|
2014-09-16 20:55:16 +01:00
|
|
|
|
2014-06-26 23:07:39 +01:00
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2014-09-15 20:19:28 +01:00
|
|
|
void
|
|
|
|
qir_remove_instruction(struct qinst *qinst)
|
|
|
|
{
|
|
|
|
remove_from_list(&qinst->link);
|
|
|
|
free(qinst->src);
|
|
|
|
free(qinst);
|
|
|
|
}
|
|
|
|
|
2014-12-10 23:37:07 +00:00
|
|
|
struct qreg
|
|
|
|
qir_follow_movs(struct qinst **defs, struct qreg reg)
|
|
|
|
{
|
|
|
|
while (reg.file == QFILE_TEMP && defs[reg.index]->op == QOP_MOV)
|
|
|
|
reg = defs[reg.index]->src[0];
|
|
|
|
|
|
|
|
return reg;
|
|
|
|
}
|
|
|
|
|
2014-06-26 23:07:39 +01:00
|
|
|
void
|
2014-08-13 21:41:22 +01:00
|
|
|
qir_compile_destroy(struct vc4_compile *c)
|
2014-06-26 23:07:39 +01:00
|
|
|
{
|
2014-09-15 20:19:28 +01:00
|
|
|
while (!is_empty_list(&c->instructions)) {
|
|
|
|
struct qinst *qinst =
|
|
|
|
(struct qinst *)first_elem(&c->instructions);
|
|
|
|
qir_remove_instruction(qinst);
|
|
|
|
}
|
|
|
|
|
2014-09-15 20:15:02 +01:00
|
|
|
ralloc_free(c);
|
2014-06-26 23:07:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
qir_get_stage_name(enum qstage stage)
|
|
|
|
{
|
|
|
|
static const char *names[] = {
|
|
|
|
[QSTAGE_FRAG] = "FS",
|
|
|
|
[QSTAGE_VERT] = "VS",
|
|
|
|
[QSTAGE_COORD] = "CS",
|
|
|
|
};
|
|
|
|
|
|
|
|
return names[stage];
|
|
|
|
}
|
2014-07-03 21:18:49 +01:00
|
|
|
|
|
|
|
#define OPTPASS(func) \
|
|
|
|
do { \
|
|
|
|
bool stage_progress = func(c); \
|
|
|
|
if (stage_progress) { \
|
|
|
|
progress = true; \
|
|
|
|
if (print_opt_debug) { \
|
|
|
|
fprintf(stderr, \
|
|
|
|
"QIR opt pass %2d: %s progress\n", \
|
|
|
|
pass, #func); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
void
|
2014-08-13 21:41:22 +01:00
|
|
|
qir_optimize(struct vc4_compile *c)
|
2014-07-03 21:18:49 +01:00
|
|
|
{
|
|
|
|
bool print_opt_debug = false;
|
|
|
|
int pass = 1;
|
|
|
|
|
|
|
|
while (true) {
|
|
|
|
bool progress = false;
|
|
|
|
|
|
|
|
OPTPASS(qir_opt_algebraic);
|
2014-08-25 08:12:21 +01:00
|
|
|
OPTPASS(qir_opt_cse);
|
2014-07-04 18:59:42 +01:00
|
|
|
OPTPASS(qir_opt_copy_propagation);
|
2014-07-04 17:48:23 +01:00
|
|
|
OPTPASS(qir_opt_dead_code);
|
2014-12-10 22:56:46 +00:00
|
|
|
OPTPASS(qir_opt_small_immediates);
|
2014-07-03 21:18:49 +01:00
|
|
|
|
|
|
|
if (!progress)
|
|
|
|
break;
|
|
|
|
|
|
|
|
pass++;
|
|
|
|
}
|
|
|
|
}
|