This is the mail archive of the
mailing list for the GCC project.
Re: add_branch_dependences in sched-rgn.c
- From: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>
- Date: Fri, 11 Apr 2014 06:03:32 +1200
- Subject: Re: add_branch_dependences in sched-rgn.c
- Authentication-results: sourceware.org; auth=none
- References: <534420B7 dot 4050004 at arm dot com> <A7B25C1A-D243-42E4-81E2-56035F62BF5D at linaro dot org> <5346AEEE dot 9020504 at arm dot com>
On Apr 11, 2014, at 2:47 AM, Kyrill Tkachov <email@example.com> wrote:
> On 10/04/14 02:50, Maxim Kuvyrkov wrote:
>> On Apr 9, 2014, at 4:15 AM, Kyrill Tkachov <firstname.lastname@example.org> wrote:
>>> Hi all,
>>> I'm looking at some curious pre-reload scheduling behaviour and I noticed this:
>>> At the add_branch_dependences function sched-rgn.c there is a comment that says "branches, calls, uses, clobbers, cc0 setters, and instructions that can throw exceptions" should be scheduled at the end of the basic block.
>>> However right below it the code that detects this kind of insns seems to only look for these insns that are directly adjacent to the end of the block (implemented with a while loop that ends as soon as the current insn is not one of the aforementioned).
>>> Shouldn't the code look through the whole basic block, gather all of the branches, clobbers etc. and schedule them at the end?
>> Not really. The instruction sequences mentioned in the comment end basic block by definition -- if there is a jump or other "special" sequence, then basic block can't continue beyond that as control may be transffered to something other than the next instruction.
> Makes sense for things like branches, calls and potential exception-throwers, but how can clobbers and uses change the control flow?
It might be that uses and clobbers are leftovers from before-data-flow infrastructure. You can try removing them from add_branch_dependencies and see what happens.