[mn10300] use the post-reload compare elimination pass
Jeff Law
law@redhat.com
Tue Nov 30 18:34:00 GMT 2010
On 11/29/10 16:54, Richard Henderson wrote:
> This is the backend patch that makes use of the -fcompare-elim pass.
>
> This only attempts to handle PLUS, MINUS, AND, OR, XOR in how they
> set the flags. Further work along these lines could handle shifts,
> but its clear that PLUS is the most complicated case.
>
> Note that BTST is handled via the pre-reload combine pass and
> another cbranch variant. At least the register form was easy
> enough to handle that way. I didn't try to handle the memory form.
>
> Comments?
My backend-fu is a bit rusty. For a comparison operator, we don't use
modes, right? It appears that the old cbranchsi4_post_reload had CCmode
when it generated the comparison:
- emit_jump_insn (gen_integer_conditional_branch
- (gen_rtx_fmt_ee (GET_CODE (operands[3]),
- CCmode,
- gen_rtx_REG (CCmode, CC_REG),
- const0_rtx),
- operands[2]));
The new code in split_cbranch uses VOIDmode:
+ x = gen_rtx_fmt_ee (GET_CODE (cmp_op), VOIDmode, flags, const0_rtx);
I simply don't recall what (if any) rules/guidelines we had for include
a mode on the comparison rtx.
You need to update the comment before the cmpsi pattern. I think the
first hunk of the comment shoudl probably remain unchanged, the second
part however, needs updating.
Is there some reason why you took out the ZERO_EXTRACT cost from
mn10300_rtx_costs?
You eliminated the negsi2 expander, was that on purpose? Presumably
it's handled generically these days? (if not, it should)?
Overall it looks pretty reasonable. In a lot of ways the resulting md
file looks cleaner to me.
I guess the ultimate test is whether or not it actually works :-)
jeff
More information about the Gcc-patches
mailing list