aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-12-17 00:15:07 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2020-12-17 00:15:07 +0000
commit0d74260a1f6704da869b87d163f4be31fd0f2b41 (patch)
treeecb8e15bf6da3cd0a8a96cc22819679f05ec439c /gcc/rtlanal.c
parenteb74135dd35213f800f434df92b2835ce49f8ea6 (diff)
downloadgcc-0d74260a1f6704da869b87d163f4be31fd0f2b41.zip
gcc-0d74260a1f6704da869b87d163f4be31fd0f2b41.tar.gz
gcc-0d74260a1f6704da869b87d163f4be31fd0f2b41.tar.bz2
recog: Add a class for propagating into insns
This patch adds yet another way of propagating into an instruction and simplifying the result. (The net effect of the series is to keep the total number of propagation approaches the same though, since a later patch removes the fwprop.c routines.) One of the drawbacks of the validate_replace_* routines is that they only do simple simplifications, mostly canonicalisations: /* Do changes needed to keep rtx consistent. Don't do any other simplifications, as it is not our job. */ if (simplify) simplify_while_replacing (loc, to, object, op0_mode); But substituting can often lead to real simplification opportunities. simplify-rtx.c:simplify_replace_rtx does fully simplify the result, but it only operates on specific rvalues rather than full instruction patterns. It is also nondestructive, which means that it returns a new rtx whenever a substitution or simplification was possible. This can create quite a bit of garbage rtl in the context of a speculative recog, where changing the contents of a pointer is often enough. The new routines are therefore supposed to provide simplify_replace_rtx- style substitution in recog. They go to some effort to prevent garbage rtl from being created. At the moment, the new routines fail if the pattern would still refer to the old "from" value in some way. That might be unnecessary in some contexts; if so, it could be put behind a configuration parameter. gcc/ * recog.h (insn_propagation): New class. * recog.c (insn_propagation::apply_to_mem_1): New function. (insn_propagation::apply_to_rvalue_1): Likewise. (insn_propagation::apply_to_lvalue_1): Likewise. (insn_propagation::apply_to_pattern_1): Likewise. (insn_propagation::apply_to_pattern): Likewise. (insn_propagation::apply_to_rvalue): Likewise.
Diffstat (limited to 'gcc/rtlanal.c')
0 files changed, 0 insertions, 0 deletions