Commit 0d682900 by Jan Hubicka Committed by Jan Hubicka

i386.md (and promoting splitters): Disable QI to SImode promoting when doing so…

i386.md (and promoting splitters): Disable QI to SImode promoting when doing so changes immediate to be 32bit.


	* 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.

From-SVN: r54327
parent c991649c
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.
......
......@@ -16358,6 +16358,8 @@
&& 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))
......@@ -16371,16 +16373,17 @@
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)))]
......
......@@ -3205,7 +3205,7 @@ try_split (pat, trial, last)
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)
......@@ -4069,6 +4069,82 @@ emit_line_note_after (file, line, after)
return note;
}
/* 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;
}
/* 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
......
......@@ -612,7 +612,7 @@ noce_try_store_flag (if_info)
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;
}
......@@ -747,7 +747,7 @@ noce_try_store_flag_constants (if_info)
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;
}
......@@ -807,7 +807,8 @@ noce_try_store_flag_inc (if_info)
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;
}
......@@ -859,7 +860,8 @@ noce_try_store_flag_mask (if_info)
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;
}
......@@ -954,7 +956,8 @@ noce_try_cmove (if_info)
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
......@@ -1116,7 +1119,7 @@ noce_try_cmove_arith (if_info)
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:
......@@ -1368,7 +1371,7 @@ noce_try_minmax (if_info)
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;
......@@ -1486,7 +1489,7 @@ noce_try_abs (if_info)
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;
......@@ -1758,7 +1761,7 @@ noce_process_if_block (test_bb, then_bb, else_bb, join_bb)
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! */
......@@ -2126,7 +2129,7 @@ find_cond_trap (test_bb, then_edge, else_edge)
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);
......
......@@ -3133,7 +3133,8 @@ peephole2_optimize (dump_file)
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);
......
......@@ -1375,14 +1375,20 @@ extern rtx assign_stack_temp_for_type PARAMS ((enum machine_mode,
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));
......@@ -1390,7 +1396,9 @@ extern rtx emit_line_note_after PARAMS ((const char *, 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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment