On 05/12/2015 03:32 AM, Thomas Preud'homme wrote:
From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
ow...@gcc.gnu.org] On Behalf Of Thomas Preud'homme

From: Jeff Law [mailto:l...@redhat.com]
Sent: Tuesday, May 12, 2015 4:17 AM


+
+  /* 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.

My apologize, it is the comment that is incorrect since it doesn't match
the code (a remaining of an old version of this patch). The code actually
checks that the use was dominated by the instruction before it is moved
out of the loop.



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.

I'll fix this comment right away.

Please find below a patch with the comment fixed.


*** gcc/ChangeLog ***

2015-05-12  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-05-12  Thomas Preud'homme  <thomas.preudho...@arm.com>

         * gcc.dg/loop-8.c: New test.
         * gcc.dg/loop-9.c: New test.
OK for the trunk.

Thanks for your patience,

Jeff

Reply via email to