+void ReplaceOpWithCheaperOp(operand **op, operand *cop) {
+#ifdef RANGEHUNT
+ printf ("ReplaceOpWithCheaperOp (%s:%d with %s:%d): ",
+ OP_SYMBOL((*op))->name, OP_SYMBOL((*op))->isreqv,
+ OP_SYMBOL(cop)->name, OP_SYMBOL(cop)->isreqv);
+ // if op is a register equivalent
+ if (IS_ITEMP(cop) && OP_SYMBOL((*op))->isreqv) {
+ operand **rop = &OP_SYMBOL((*op))->usl.spillLoc->reqv;
+ if (isOperandEqual(*rop, *op)) {
+ printf ("true");
+ *rop=cop;
+ OP_SYMBOL((*op))->isreqv=0;
+ OP_SYMBOL(cop)->isreqv=1;
+ } else {
+ printf ("false");
+ }
+ }
+ printf ("\n");
+#endif
+ *op=cop;
+}
+