+Thu Jun 6 23:14:46 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (and promoting splitters): Disable QI to SImode promoting
+ when doing so changes immediate to be 32bit.
+
+ * rtl.h (emit_*_scope): Declare.
+ * emit-rtl.c (emit_*_scope): New global functions.
+ (try_split): Copy scope.
+ * ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants,
+ noce_try_flag_inc, noce_try_store_flag_mask, noce_try_cmove,
+ noce_try_cmove_arith, noce_try_minmax, noce_try_abs,
+ noce_process_if_block, find_cond_trap): Copy scopes.
+ * recog.c (peephole2_optimize): likewise.
+
2002-06-06 Jeffrey Law <law@redhat.com>
* h8300.h (OK_FOR_U): Fix thinko exposed by flag checking.
&& ix86_match_ccmode (insn, CCNOmode)
&& (GET_MODE (operands[0]) == HImode
|| (GET_MODE (operands[0]) == QImode
+ /* Ensure that the operand will remain sign extended immedaite. */
+ && INTVAL (operands[2]) >= 0
&& (TARGET_PROMOTE_QImode || optimize_size)))"
[(parallel [(set (reg:CCNO 17)
(compare:CCNO (and:SI (match_dup 1) (match_dup 2))
operands[0] = gen_lowpart (SImode, operands[0]);
operands[1] = gen_lowpart (SImode, operands[1]);")
+; Don't promote the QImode tests, as i386 don't have encoding of
+; the test instruction with 32bit sign extended immediate and thus
+; the code grows.
(define_split
[(set (reg 17)
- (compare (and (match_operand 0 "aligned_operand" "")
- (match_operand 1 "const_int_operand" ""))
+ (compare (and (match_operand:HI 0 "aligned_operand" "")
+ (match_operand:HI 1 "const_int_operand" ""))
(const_int 0)))]
"! TARGET_PARTIAL_REG_STALL && reload_completed
&& ix86_match_ccmode (insn, CCNOmode)
- && (GET_MODE (operands[0]) == HImode
- || (GET_MODE (operands[0]) == QImode
- && (TARGET_PROMOTE_QImode || optimize_size)))"
+ && GET_MODE (operands[0]) == HImode"
[(set (reg:CCNO 17)
(compare:CCNO (and:SI (match_dup 0) (match_dup 1))
(const_int 0)))]
if (GET_CODE (XVECEXP (seq, 0, i)) == INSN)
mark_label_nuses (PATTERN (XVECEXP (seq, 0, i)));
- tem = emit_insn_after (seq, trial);
+ tem = emit_insn_after_scope (seq, trial, INSN_SCOPE (trial));
delete_insn (trial);
if (has_barrier)
return note;
}
\f
+/* Like emit_insn_after, but set INSN_SCOPE according to SCOPE. */
+rtx
+emit_insn_after_scope (pattern, after, scope)
+ rtx pattern, after;
+ tree scope;
+{
+ rtx last = emit_insn_after (pattern, after);
+ for (after = NEXT_INSN (after); after != last; after = NEXT_INSN (after))
+ INSN_SCOPE (after) = scope;
+ return last;
+}
+
+/* Like emit_insns_after, but set INSN_SCOPE according to SCOPE. */
+rtx
+emit_insns_after_scope (pattern, after, scope)
+ rtx pattern, after;
+ tree scope;
+{
+ rtx last = emit_insns_after (pattern, after);
+ for (after = NEXT_INSN (after); after != last; after = NEXT_INSN (after))
+ INSN_SCOPE (after) = scope;
+ return last;
+}
+
+/* Like emit_jump_insn_after, but set INSN_SCOPE according to SCOPE. */
+rtx
+emit_jump_insn_after_scope (pattern, after, scope)
+ rtx pattern, after;
+ tree scope;
+{
+ rtx last = emit_jump_insn_after (pattern, after);
+ for (after = NEXT_INSN (after); after != last; after = NEXT_INSN (after))
+ INSN_SCOPE (after) = scope;
+ return last;
+}
+
+/* Like emit_call_insn_after, but set INSN_SCOPE according to SCOPE. */
+rtx
+emit_call_insn_after_scope (pattern, after, scope)
+ rtx pattern, after;
+ tree scope;
+{
+ rtx last = emit_call_insn_after (pattern, after);
+ for (after = NEXT_INSN (after); after != last; after = NEXT_INSN (after))
+ INSN_SCOPE (after) = scope;
+ return last;
+}
+
+/* Like emit_insn_before, but set INSN_SCOPE according to SCOPE. */
+rtx
+emit_insn_before_scope (pattern, before, scope)
+ rtx pattern, before;
+ tree scope;
+{
+ rtx first = PREV_INSN (before);
+ rtx last = emit_insn_before (pattern, before);
+
+ for (first = NEXT_INSN (first); first != last; first = NEXT_INSN (first))
+ INSN_SCOPE (first) = scope;
+ return last;
+}
+
+/* Like emit_insns_before, but set INSN_SCOPE according to SCOPE. */
+rtx
+emit_insns_before_scope (pattern, before, scope)
+ rtx pattern, before;
+ tree scope;
+{
+ rtx first = PREV_INSN (before);
+ rtx last = emit_insns_before (pattern, before);
+
+ for (first = NEXT_INSN (first); first != last; first = NEXT_INSN (first))
+ INSN_SCOPE (first) = scope;
+ return last;
+}
+\f
/* Make an insn of code INSN with pattern PATTERN
and add it to the end of the doubly-linked list.
If PATTERN is a SEQUENCE, take the elements of it
seq = get_insns ();
end_sequence ();
- emit_insns_before (seq, if_info->jump);
+ emit_insns_before_scope (seq, if_info->jump, INSN_SCOPE (if_info->insn_a));
return TRUE;
}
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, if_info->jump);
+ emit_insns_before_scope (seq, if_info->jump, INSN_SCOPE (if_info->insn_a));
return TRUE;
}
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, if_info->jump);
+ emit_insns_before_scope (seq, if_info->jump,
+ INSN_SCOPE (if_info->insn_a));
return TRUE;
}
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, if_info->jump);
+ emit_insns_before_scope (seq, if_info->jump,
+ INSN_SCOPE (if_info->insn_a));
return TRUE;
}
seq = get_insns ();
end_sequence ();
- emit_insns_before (seq, if_info->jump);
+ emit_insns_before_scope (seq, if_info->jump,
+ INSN_SCOPE (if_info->insn_a));
return TRUE;
}
else
tmp = get_insns ();
end_sequence ();
- emit_insns_before (tmp, if_info->jump);
+ emit_insns_before_scope (tmp, if_info->jump, INSN_SCOPE (if_info->insn_a));
return TRUE;
end_seq_and_fail:
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, if_info->jump);
+ emit_insns_before_scope (seq, if_info->jump, INSN_SCOPE (if_info->insn_a));
if_info->cond = cond;
if_info->cond_earliest = earliest;
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, if_info->jump);
+ emit_insns_before_scope (seq, if_info->jump, INSN_SCOPE (if_info->insn_a));
if_info->cond = cond;
if_info->cond_earliest = earliest;
insn_b = gen_sequence ();
end_sequence ();
- emit_insn_after (insn_b, test_bb->end);
+ emit_insn_after_scope (insn_b, test_bb->end, INSN_SCOPE (insn_a));
}
/* Merge the blocks! */
return FALSE;
/* Emit the new insns before cond_earliest. */
- emit_insn_before (seq, cond_earliest);
+ emit_insn_before_scope (seq, cond_earliest, INSN_SCOPE (trap));
/* Delete the trap block if possible. */
remove_edge (trap_bb == then_bb ? then_edge : else_edge);
REG_EH_REGION, NULL_RTX);
/* Replace the old sequence with the new. */
- try = emit_insn_after (try, peep2_insn_data[i].insn);
+ try = emit_insn_after_scope (try, peep2_insn_data[i].insn,
+ INSN_SCOPE (peep2_insn_data[i].insn));
before_try = PREV_INSN (insn);
delete_insn_chain (insn, peep2_insn_data[i].insn);
extern rtx assign_temp PARAMS ((tree, int, int, int));
/* In emit-rtl.c */
extern rtx emit_insn_before PARAMS ((rtx, rtx));
+extern rtx emit_insn_before_scope PARAMS ((rtx, rtx, tree));
extern rtx emit_jump_insn_before PARAMS ((rtx, rtx));
+extern rtx emit_jump_insn_before_scope PARAMS ((rtx, rtx, tree));
extern rtx emit_call_insn_before PARAMS ((rtx, rtx));
+extern rtx emit_call_insn_before_scope PARAMS ((rtx, rtx, tree));
extern rtx emit_barrier_before PARAMS ((rtx));
extern rtx emit_label_before PARAMS ((rtx, rtx));
extern rtx emit_note_before PARAMS ((int, rtx));
extern rtx emit_insn_after PARAMS ((rtx, rtx));
+extern rtx emit_insn_after_scope PARAMS ((rtx, rtx, tree));
extern rtx emit_jump_insn_after PARAMS ((rtx, rtx));
+extern rtx emit_jump_insn_after_scope PARAMS ((rtx, rtx, tree));
extern rtx emit_call_insn_after PARAMS ((rtx, rtx));
+extern rtx emit_call_insn_after_scope PARAMS ((rtx, rtx, tree));
extern rtx emit_barrier_after PARAMS ((rtx));
extern rtx emit_label_after PARAMS ((rtx, rtx));
extern rtx emit_note_after PARAMS ((int, rtx));
extern rtx emit_insn PARAMS ((rtx));
extern rtx emit_insns PARAMS ((rtx));
extern rtx emit_insns_before PARAMS ((rtx, rtx));
+extern rtx emit_insns_before_scope PARAMS ((rtx, rtx, tree));
extern rtx emit_insns_after PARAMS ((rtx, rtx));
+extern rtx emit_insns_after_scope PARAMS ((rtx, rtx, tree));
extern rtx emit_jump_insn PARAMS ((rtx));
extern rtx emit_call_insn PARAMS ((rtx));
extern rtx emit_label PARAMS ((rtx));