This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, ping 1] Move insns without introducing new temporaries in loop2_invariant


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

From: Jeff Law [mailto:law@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.preudhomme@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.preudhomme@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]