Message ID | CAFULd4Y2cxgZE8XV=Wxz=-jLzdaNO6hoz+A0rXKb9XPQr6ju_Q@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Sat, Jan 14, 2017 at 11:19 AM, Uros Bizjak <ubizjak@gmail.com> wrote: > On Fri, Jan 13, 2017 at 4:58 PM, Uros Bizjak <ubizjak@gmail.com> wrote: >> On Fri, Jan 13, 2017 at 12:50 PM, Alan Modra <amodra@gmail.com> wrote: >>> Rather than using unspecs in doloop insns to stop combine creating >>> these insns, use legitimate_combined_insn. >>> >>> I'm not sure why the original patch implementing >>> legitimate_combined_insn did not store the result of recog to the insn >>> but it seems good to me, and would allow the recog call in >>> ix86_legitimate_combined_insn to be omitted. (I tested that too, not >>> shown here.) >> >> IIRC, I copied operand scanning loop from recog.c (around line 2580) >> and the function was later enhanced with preferred alternatives >> handling. The function worked well, and not being an expert in this >> area, I didn't try to "optimize" the code that worked... >> >> So, there is no particular reason for the current implementation. > > FYI, the following patch immediately crashed build: Bah, it would help if I actually saved source with proposed combine.c change. Testing the patch... Uros.
Index: i386.c =================================================================== --- i386.c (revision 244463) +++ i386.c (working copy) @@ -8130,7 +8130,7 @@ ix86_legitimate_combined_insn (rtx_insn *insn) generating insn patterns with invalid hard register operands. These invalid insns can eventually confuse reload to error out with a spill failure. See also PRs 46829 and 46843. */ - if ((INSN_CODE (insn) = recog (PATTERN (insn), insn, 0)) >= 0) + if (INSN_CODE (insn) >= 0) { int i;