• Home
  • Raw
  • Download

Lines Matching +full:- +full:i1

2  * CSE - walk the linearized instruction flow, and
27 const struct instruction *def1 = phi1->def; in phi_compare()
28 const struct instruction *def2 = phi2->def; in phi_compare()
30 if (def1->src1 != def2->src1) in phi_compare()
31 return def1->src1 < def2->src1 ? -1 : 1; in phi_compare()
32 if (def1->bb != def2->bb) in phi_compare()
33 return def1->bb < def2->bb ? -1 : 1; in phi_compare()
42 hash = (insn->opcode << 3) + (insn->size >> 3); in cse_collect()
43 switch (insn->opcode) { in cse_collect()
45 hash += hashval(insn->src3); in cse_collect()
67 /* floating-point arithmetic & comparison */ in cse_collect()
73 hash += hashval(insn->src2); in cse_collect()
80 hash += hashval(insn->src1); in cse_collect()
84 hash += hashval(insn->bb_true); in cse_collect()
88 hash += hashval(insn->val); in cse_collect()
92 hash += hashval(insn->fvalue); in cse_collect()
99 if (!insn->orig_type || insn->orig_type->bit_size < 0) in cse_collect()
101 hash += hashval(insn->src); in cse_collect()
104 hash += hashval(insn->orig_type->bit_size); in cse_collect()
110 FOR_EACH_PTR(insn->phi_list, phi) { in cse_collect()
112 if (phi == VOID || !phi->def) in cse_collect()
114 def = phi->def; in cse_collect()
115 hash += hashval(def->src1); in cse_collect()
116 hash += hashval(def->bb); in cse_collect()
129 hash &= INSN_HASH_SIZE-1; in cse_collect()
133 /* Compare two (sorted) phi-lists */
143 while (phi1 && (phi1 == VOID || !phi1->def)) in phi_list_compare()
145 while (phi2 && (phi2 == VOID || !phi2->def)) in phi_list_compare()
149 return phi2 ? -1 : 0; in phi_list_compare()
165 const struct instruction *i1 = _i1; in insn_compare() local
170 if (i1->opcode != i2->opcode) in insn_compare()
171 return i1->opcode < i2->opcode ? -1 : 1; in insn_compare()
173 switch (i1->opcode) { in insn_compare()
181 if (i1->src1 == i2->src2 && i1->src2 == i2->src1) in insn_compare()
186 if (i1->src3 != i2->src3) in insn_compare()
187 return i1->src3 < i2->src3 ? -1 : 1; in insn_compare()
188 /* Fall-through to binops */ in insn_compare()
203 /* floating-point arithmetic */ in insn_compare()
210 if (i1->src2 != i2->src2) in insn_compare()
211 return i1->src2 < i2->src2 ? -1 : 1; in insn_compare()
218 if (i1->src1 != i2->src1) in insn_compare()
219 return i1->src1 < i2->src1 ? -1 : 1; in insn_compare()
223 if (i1->bb_true != i2->bb_true) in insn_compare()
224 return i1->bb_true < i2->bb_true ? -1 : 1; in insn_compare()
228 if (i1->val != i2->val) in insn_compare()
229 return i1->val < i2->val ? -1 : 1; in insn_compare()
233 diff = memcmp(&i1->fvalue, &i2->fvalue, sizeof(i1->fvalue)); in insn_compare()
240 return phi_list_compare(i1->phi_list, i2->phi_list); in insn_compare()
246 if (i1->src != i2->src) in insn_compare()
247 return i1->src < i2->src ? -1 : 1; in insn_compare()
249 // Note: if it can be guaranted that identical ->src in insn_compare()
250 // implies identical orig_type->bit_size, then this in insn_compare()
254 size1 = i1->orig_type->bit_size; in insn_compare()
255 size2 = i2->orig_type->bit_size; in insn_compare()
257 return size1 < size2 ? -1 : 1; in insn_compare()
261 warning(i1->pos, "bad instruction on hash chain"); in insn_compare()
263 if (i1->size != i2->size) in insn_compare()
264 return i1->size < i2->size ? -1 : 1; in insn_compare()
275 convert_instruction_target(insn, def->target); in cse_one_instruction()
286 if (bb_list_size(bb1->parents) != 1) in trivial_common_parent()
288 parent = first_basic_block(bb1->parents); in trivial_common_parent()
289 if (bb_list_size(bb2->parents) != 1) in trivial_common_parent()
291 if (first_basic_block(bb2->parents) != parent) in trivial_common_parent()
301 static struct instruction * try_to_cse(struct entrypoint *ep, struct instruction *i1, struct instru… in try_to_cse() argument
306 * OK, i1 and i2 are the same instruction, modulo "target". in try_to_cse()
309 b1 = i1->bb; in try_to_cse()
310 b2 = i2->bb; in try_to_cse()
314 * the CSE is inside one basic-block. in try_to_cse()
318 FOR_EACH_PTR(b1->insns, insn) { in try_to_cse()
319 if (insn == i1) in try_to_cse()
320 return cse_one_instruction(i2, i1); in try_to_cse()
322 return cse_one_instruction(i1, i2); in try_to_cse()
324 warning(b1->pos, "Whaa? unable to find CSE instructions"); in try_to_cse()
325 return i1; in try_to_cse()
328 return cse_one_instruction(i2, i1); in try_to_cse()
331 return cse_one_instruction(i1, i2); in try_to_cse()
333 /* No direct dominance - but we could try to find a common ancestor.. */ in try_to_cse()
336 i1 = cse_one_instruction(i2, i1); in try_to_cse()
337 remove_instruction(&b1->insns, i1, 1); in try_to_cse()
338 insert_last_instruction(common, i1); in try_to_cse()
340 i1 = i2; in try_to_cse()
343 return i1; in try_to_cse()
360 if (!insn->bb) in cse_eliminate()