<src start="6" mask="0xf7"/>
</ins>
- <ins name="+KABOOM" mask="0xffff8" exact="0xd7858" unused="true" message="job_management">
+ <ins name="+KABOOM" mask="0xffff8" exact="0xd7858" message="job" dests="0">
<src start="0"/>
</ins>
bi_opt_dead_code_eliminate(ctx);
}
-#define CASE(instr, expected) INSTRUCTION_CASE(instr, expected, bi_optimizer)
+/* Define reg first so it has a consistent variable index, and pass it to an
+ * instruction that cannot be dead code eliminated so the program is nontrivial.
+ */
+#define CASE(instr, expected) INSTRUCTION_CASE(\
+ { UNUSED bi_index reg = bi_temp(b->shader); instr; bi_kaboom(b, reg); }, \
+ { UNUSED bi_index reg = bi_temp(b->shader); expected; bi_kaboom(b, reg); }, \
+ bi_optimizer);
+
#define NEGCASE(instr) CASE(instr, instr)
class Optimizer : public testing::Test {
Optimizer() {
mem_ctx = ralloc_context(NULL);
- reg = bi_register(0);
x = bi_register(1);
y = bi_register(2);
negabsx = bi_neg(bi_abs(x));
void *mem_ctx;
- bi_index reg;
bi_index x;
bi_index y;
bi_index negabsx;