hash = HASH(hash, index.neg);
hash = HASH(hash, index.swizzle);
hash = HASH(hash, index.offset);
- hash = HASH(hash, index.reg);
hash = HASH(hash, index.type);
return hash;
}
if (I->branch_target)
return false;
- /* Refuse to CSE non-SSA destinations since the data flow analysis
- * required is nontrivial */
- bi_foreach_dest(I, d) {
- if (!bi_is_null(I->dest[d]) && !bi_is_ssa(I->dest[d]))
- return false;
- }
-
- /* Similar refuse to CSE non-SSA sources. We allow machine registers,
- * since CSE runs before register allocation which means any registers
- * encountered are preloaded and hence assumed constant.
- */
- bi_foreach_src(I, s) {
- if (I->src[s].reg)
- return false;
- }
-
return true;
}
const bi_instr *match = entry->key;
bi_foreach_dest(instr, d) {
- if (!bi_is_null(instr->dest[d]))
- replacement[instr->dest[d].value] = match->dest[d];
+ replacement[instr->dest[d].value] = match->dest[d];
}
}
}