This is the mail archive of the
mailing list for the GCC project.
Re: Scheduler:LLVM vs gcc, which is better
- From: Chandler Carruth <chandlerc at gmail dot com>
- To: lin zuojian <manjian2006 at gmail dot com>
- Cc: Chandler Carruth <chandlerc at gmail dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Mon, 10 Mar 2014 20:03:01 -0700
- Subject: Re: Scheduler:LLVM vs gcc, which is better
- Authentication-results: sourceware.org; auth=none
- References: <20140311015901 dot GA23856 at ubuntu> <CAGCO0KgGdkT_RxpLSP08dX7sQep29ENriyVmYgJogC9kQ5-rWg at mail dot gmail dot com> <20140311023335 dot GB23856 at ubuntu>
On Mon, Mar 10, 2014 at 7:33 PM, lin zuojian <email@example.com> wrote:
> I just ask for opinions.I think many GCC developers do familiar with
> the opponent.If I ask in the LLVM mailing list, I have to worry
> about If they are familiar with GCC, too(what's sched2 pass?).
I suspect you will have the same problem on both lists. The internal
details of the scheduling system are not likely to be widely known
To provide a very brief summary of what is going on in LLVM to the
best of my knowledge (although I am not one of the experts on this
The DAG (or more fully, the SelectionDAG) is not really relevant to
scheduling any more. It is just a mechanism used for legalization
and combining the target-specific representation prior to producing
very low level "MI" or Machine Instructions. That is, it is entirely
an instruction selection tool, not a a scheduling tool.
The scheduling takes place amongst the machine instructions either
before or after register allocation (depending on the target) and with
a wide variety of heuristics. My understanding is that it is
attempting to solve the same fundamental scheduling problems as GCC's
infrastructure (ILP and register pressure). The infrastructure is the
bulk of it though, and that is likely entirely specific to the
representation and innards of the respective compilers.
Given that LLVM's machine level scheduler is significantly younger
than GCC's, I would expect it to be less well tuned and have less
complete and/or accurate modeling for some targets.
 Historically, we did both instruction selection and scheduling
using the DAG, but the scheduling has moved into the MI layer
specifically to address register pressure and ILP concerns that were
hard/impossible to handle at a higher level. There is some hope that
the DAG goes away completely and is replaced with some simpler
selection and legalization framework, but that hasn't yet emerged.