This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH, GCC, stage1] Fallback to copy-prop if constant-prop not possible
- From: "Thomas Preud'homme" <thomas dot preudhomme at arm dot com>
- To: "'Steven Bosscher'" <stevenb dot gcc at gmail dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 23 Mar 2015 19:01:09 +0800
- Subject: RE: [PATCH, GCC, stage1] Fallback to copy-prop if constant-prop not possible
- Authentication-results: sourceware.org; auth=none
- References: <000501d049d3$079385a0$16ba90e0$ at arm dot com> <CABu31nMdEDzr_mPvZvN=zuLMmGRDBP3wDb-6FLX2xUz13Qn2fw at mail dot gmail dot com> <000601d04a5c$a0c0f030$e242d090$ at arm dot com> <CABu31nO-FyF_T3KCv1PW-ndAotCKdxpjzROm7kjTEb5p2DEt3A at mail dot gmail dot com> <000001d062e8$ece63930$c6b2ab90$ at arm dot com> <000101d062f8$68a35350$39e9f9f0$ at arm dot com> <CABu31nMq-md5ZRAovEzcOM8tPYH8GJZn-pb6tQTPJcHA=F=zjg at mail dot gmail dot com>
> From: Steven Bosscher [mailto:stevenb.gcc@gmail.com]
> Sent: Friday, March 20, 2015 8:14 PM
>
> I put the cprop_reg_p check there instead of !HARD_REGISTER_P
> because
> I like to be able to quickly find all places where a similar check is
> performed. The check is whether the reg is something that copy
> propagation can handle, and that is what I added cprop_reg_p for.
Makes sense indeed. I didn't think about the meaning of it.
> (Note that cprop can _currently_ handle only pseudos but there is no
> reason why a limited set of hard regs can't be handled also, e.g. the
> flag registers like in targetm.fixed_condition_code_regs).
>
> In this case, the result is that REG_P is checked twice.
> But then again, cprop_reg_p will be inlined and the double check
> optimized away.
True.
>
> Anyway, I guess we've bikeshedded long enough over this patch as it is
> :-) Let's post a final form and declare it OK for stage1.
What about the cprop_reg_p that needs to be negated? Did I miss something
that makes it ok?
>
> As for PSEUDO_REG_P: If it were up to me, I'd like to have in rtl.h:
>
> static bool
> hard_register_p (rtx x)
> {
> return (REG_P (x) && HARD_REGISTER_NUM_P (REGNO (x)));
> }
>
> static bool
> pseudo_register_p (rtx x)
> {
> return (REG_P (x) && !HARD_REGISTER_NUM_P (REGNO (x)));
> }
>
> and do away with all the FIRST_PSEUDO_REGISTER tests. But I've
> proposed this in the past and there was opposition. Perhaps when we
> introduce a rtx_reg class...
Ok I'll try to dig up what was the reasons presented. Anyway, it would
be done in a separate patch so not a problem for this one.
FYI testing your patch with the one cprop_reg_p negated as said in my
previous email shows no regression on arm-none-eabi cross-compiler
targeting Cortex-M3. Testing for x86_64 is ongoing.
Best regards,
Thomas