On 05/06/2015 03:47 AM, Thomas Preud'homme wrote:
Ping?
Something to consider as future work -- I'm pretty sure PRE sets up the
same kind of problematical pattern with a new pseudo (reaching reg)
holding the result of the redundant expression and the original
evaluations turned into copies from the reaching reg to the final
destination.
That style is easy to prove correct. There was an issue with the copies
not propagating away that was pretty inherent in the partial redundancy
cases that I could probably dig out of my archives if you're interested.
So here are the new ChangeLog entries:
*** gcc/ChangeLog ***
2015-03-11 Thomas Preud'homme <thomas.preudho...@arm.com>
* loop-invariant.c (can_move_invariant_reg): New.
(move_invariant_reg): Call above new function to decide whether
instruction can just be moved, skipping creation of temporary
register.
*** gcc/testsuite/ChangeLog ***
2015-03-12 Thomas Preud'homme <thomas.preudho...@arm.com>
* gcc.dg/loop-8.c: New test.
* gcc.dg/loop-9.c: New test.
It looks like there's a variety of line wrapping issues. Please
double-check line wrapping using an 80 column window. Minor I know, but
the consistency with the rest of the code is good.
+
+ /* Check that all uses reached by the def in insn would still be reached
+ it. */
+ dest_regno = REGNO (reg);
+ for (use = DF_REG_USE_CHAIN (dest_regno); use; use =
DF_REF_NEXT_REG (use))
[ ... ]
So isn't this overly conservative if DEST_REGNO is set multiple times
since it's going to look at all the uses, even those not necessarily
reached by the original SET of DEST_REGNO?
Or is that not an issue for some reason? And I'm not requiring you to
make this optimal, but if I'm right, a comment here seems wise.
I think with the wrapping nits fixed and closure on the multi-set issue
noted immediately above and this will be good for the trunk.
Jeff