[llvm-dev] Submitting an Experimental Target

Nikita Ermoshkin via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 24 18:11:05 PST 2021

Hi LLVM Folks

This is a rather long message with many questions, so sorry for that.

Over the last year-ish I created a new experimental target for the
Propeller 2 microcontroller. It lives in my own fork of llvm-project here:

(Someone else had also reached out about creating their own target for P2
after they saw my work and the discussion was here, but I think their
effort died as I haven’t heard any updates from them. That discussion was
here https://lists.llvm.org/pipermail/llvm-dev/2021-February/148739.html)

It’s not 100% complete (not all instructions are implemented yet, as
there’s like 400 of them, mostly for controlling various hardware
peripherals), but it’s relatively functional and can do most things that
one commonly would want to do, and I’ve got a supporting C and runtime
library. It’s about time it makes it’s way into the mainline LLVM repo I
think, as there seem to be often changes to backend structure, prototypes,
etc that whenever I pull in main into my fork, everything breaks and I
spend two days refactoring my code to fix it, so it would be nice to have
that changed by whoever as actually making the changes.

1. Is submitting an “in development” backend that’s in this state and
leaving it experimental acceptable? If not, what are the minimum

2. My code doesn’t currently conform to LLVM’s style guide. Is this
acceptable for an experimental/in development target?

I struggle with LLVM’s style (just different than how I write code) so I
want to avoid going through and fixing all the little things until actually

3. Currently, I am the only maintainer of this fork, so I would be the code
owner. Does this mean I’d be on the hook for reviewing all the changes that
might come down the pipeline that aren’t explicitly affecting functionality
(say, some change in the Target class definition)

I hope to get more folks from the Propeller community working on this in
the future, but it’s a rather small project for now.

On the testing side, I have a series of simple tests that run on the actual
hardware (no simulator is available). They are not exhaustive of compiler
features, microcontroller features, or code coverage of the target code in
LLVM. They are just the bare minimum I run to make sure I didn’t break
something massive and I can still compile and run simple applications.

4. What is the minimum set of tests for the experimental target that must
exist within the LLVM test suite. Is it acceptable to have none (since I’m
the only developer and can run tests on my own)?

Now to actually submit this change:

5. Is submitting this fork to be reviewed and merged as simple as creating
a patch and submitting it through Phabricator? (As described here:
https://llvm.org/docs/DeveloperPolicy.html#making-and-submitting-a-patch and
here: https://llvm.org/docs/Phabricator.html) Or is there a different
process since this is such a large change?


6. Is there anything else I should know about submitting a new target? The
dev policy docs (
https://llvm.org/docs/DeveloperPolicy.html#adding-a-new-target) don’t have
a ton of info on it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211224/96d272df/attachment.html>

More information about the llvm-dev mailing list