[LLVMdev] running clang format on the Mips target

Reed Kotler Reed.Kotler at imgtec.com
Sat Dec 21 12:55:51 PST 2013


Daniel Sanders is the official maintainer for the Mips LLVM port. 

If you are finding bugs, you should be filing them. We even have an open facing bugzilla for Mips. It would be
possible to arrange you to have an account there. Or you could file them in the official LLVM bugzilla.

If you want to help and fix them yourself or contribute other work; that's great and is very welcome.

When you do that; you should make a patch and push them upstream.

I seriously doubt that anyone at imagination/Mips is going to spend time digging though some external Git
repository to glean possible changes.

At this time you don't have pre-commit privilege so you need to submit them for review, like we all needed to in the beginning including Akira and myself, and get them approved. After some time it's possible to get promoted to post commit review. All of us are subject to post-commit review and per the rules of LLVM, Daniel, being the Mips maintainer, is the final word on any changes to the Mips target and all of us have to adhere to that.

There are procedures in LLVM for all these things and nobody is exempt from them.

Our compiler passes test-suite for Mips32, mips16 and micro mips. It can recurse itself and work on all the
standard benchmarks, plumhall c/c++/c++ library and many other things. Several years back, someone from outside
of Mips, who is not connected to Mips in any way, tested all the compilers with some networking test suites and code and the Mips compiler was the only one at that time that passed 100% out of the box.

Does it have bugs? Most likely unless physics somehow works differently for us.  We run our own build bots on many flavors of the compiler
every night and it's a "stop all new work" whenever any of these variants goes red. 

All compilers (and software) have bugs otherwise nobody would have invented bugzilla or any of the hundreds of other bug tracking programs.

If you have patches that would help clean up parts of the compiler; these are also welcome but you have to go through
the procedures that we all have to go through.

If it's something major, then you would be advised to submit an RFC and get some kind of buy in from the rest of the
Mips team before doing them.

Reed
________________________________________
From: Dr D. Chisnall [dc552 at hermes.cam.ac.uk] on behalf of David Chisnall [David.Chisnall at cl.cam.ac.uk]
Sent: Saturday, December 21, 2013 12:06 PM
To: Reed Kotler
Cc: LLVMdev at cs.uiuc.edu
Subject: Re: [LLVMdev] running clang format on the Mips target

Hi Reed,

On 21 Dec 2013, at 19:20, Reed Kotler <Reed.Kotler at imgtec.com> wrote:

> Hi David,
>
> What kind of  "a lot of out-of-tree changes"?

Support for a new (experimental) processor architecture, which is not likely to be  upstreamed because it's not of interest to anyone who isn't using our architecture.  While these changes are public, there is no point in upstreaming them (they also include some hacks in the middle parts of LLVM to support fat pointers, which might be cleaned up and upstreamed at some point if anyone apart from us is interested in fat pointers), because it's a rapidly changing experimental ISA.  Our processor runs FreeBSD, and so I've also been fixing things that are required to let us move the FreeBSD/MIPS build from gcc 4.2.1 to clang.

> You should push changes incrementally as you do work. Holding onto changes means that many things,
> not just reformatting, can make them need to be redone.  We frequently clean up and rewrite
> code to make it cleaner and easier to maintain.
>
> We are moving to a more strict internal review and pushing of changes and post commit reviewing.

I have had to fix a large number of bugs in the MIPS back end to allow us to build parts of the FreeBSD kernel and userland with LLVM.  It would be nice if you had worked on getting the basic functionality working before chasing microMIPS and the various ASE things.

For us, the first priority is getting things to work with our branch.  Once we've got things into a state where it's tested, we'll start upstreaming things.  Our code is on github and Jack has the URL, so feel free to pull in anything you want in the meantime, or if there are specific revisions that you'd like me to clean up and rebase I'd be happy to do so.  In particular, we have dsub* and daddi, dli, dla, la, and .cpsetup implemented (although not the most efficient implementation of any of them, hence these patches not being ready for upstreaming), .set noat / at doing the right thing, and have fixed (I think) MIPS IV support (although not yet MIPS III, which is an oversight given that Loongson 2F is MIPS III).

> It takes time to review and respond to comments on formatting issues; time that would be better spent doing new work.

Has anyone done a code review of the existing MIPS back end?

> So we would like to have robots, i.e. clang format, do this checking and such.
>
> I would recommend that you start to submit your patches for review.

I intend to in the new year (and I've already mentioned this to Jack and Vladimir), but only the ones that are relevant for other MIPS consumers.  Given the large number of non-standard extensions to MIPS that abound now (and this will only increase when we open source our softcore in the new year), I imagine that there will be no shortage of other MIPS-based back ends being maintained out of tree.  The poor modularity in the existing code makes it difficult to upstream these, although I've been (very slowly) working on fixing that in our branch.

David






More information about the llvm-dev mailing list