I am interested in developing a backend for the PIC microcontrollers. Specifically, I plan to write for the 8-bit MCUs, but would hopefully also support the 16 and 32 bit models (eventually). It is my understanding that a backend for PIC16 was previously a part of the project but was dropped in version 2.9. Is there any development on this front currently? Is there any interest in developing this for the current build of LLVM? Why was the original support dropped? Would it make a good basis for current support, or has the core software changed too much since then? I would appreciate hearing from anyone who has any insight. Thank you. - Woodrow Barlow -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150601/aeb527b8/attachment.html>
Hi Woodrow, I have thought about introducing a PIC back-end just for fun, but since there was one already dying, I gave up. It'd be great to have one again, but we must not follow the steps of the previous back-end, or the fate will be the same. On 1 June 2015 at 05:55, Woodrow Barlow <wjbarlow at ncsu.edu> wrote:> Is there any development on this front currently?Not that I'm aware of.> Is there any interest in developing this for the current build of LLVM?Interest in developing, probably not. Interest in having it, sure, why not! However, a back-end maintainer has to provide a few "guarantees" to continue supporting in tree: 1. You must have a public buildbot that can test your code. Since you'll always cross compile, having a good set of tests in x86 mode would do, but having execution tests would increase the quality by a large amount. If at all possible, I'd recommend a cross-compilation buildbot that runs some embedded code in a proper PIC. 2. Since this is an uncommon target, you'll need to be responsive to bugs in your back-end. If one commit breaks your tests, we'll probably revert until it can be fixed, but without PIC knowledge, it'll be hard to fix the problem in your back-end. Lack of execution tests, as mentioned above, will increase the uncertainty. 3. You should follow the high level discussions about DAG lowering, register allocation, etc., as any of that might change how your back-end behaves. Breaking your back-end by changing any of those high-level parts of the code is reasonably common. You can be either proactive, and help us make those changes on your back-end, or reactive as point (2) above, and fix promptly any bug that shows up.> Why was the original support dropped?Because the previous maintainer didn't follow the rules above. :) Any part of the code that bit rots (remains untouched for a long time with no one responsible for it) will be discarded. This is kind of a life contract, too. You or someone else will have to keep an eye on the back-end for as long as LLVM lives, or as long as you care about a PIC back-end in LLVM. It's like reference counted smart pointers... The last one to leave, turn the lights off.> Would it make a good basis for current support, or > has the core software changed too much since then?The core has changed drastically, but some of the basics of building a back-end are still the same. There is plenty of documentation available to help you with that. Some examples: http://llvm.org/docs/WritingAnLLVMBackend.html http://llvm.org/devmtg/2014-04/PDFs/Talks/Building%20an%20LLVM%20backend.pdf http://llvm.org/devmtg/2014-10/Slides/Cormack-BuildingAnLLVMBackend.pdf (same, but newer) http://jonathan2251.github.io/lbd/ But digging the old code and looking at the patterns would probably help you to get started. Also, check the other back-ends for implementing common patterns, and try to leave as much as you can to the generic parts of the code. cheers, --renato PS: I may know a few people that would be interested in helping... Let me ask around.
Hi,> Specifically, I plan to write for the 8-bit MCUs, but would hopefully also support the 16 and 32 bit models (eventually).I assume the subject meant to say Microchip and the extra 'p' is a typo. The 32-bit models should already be supported by the Mips backend. The PIC32MX family use the MIPS M4K, and the PIC32MZ family use the MIPS microAptiv. Both of these implement the MIPS32 and microMIPS ISA's.> Why was the original support dropped?I don't know about this particular case but the usual reason is a lack of anyone to maintain support. From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Woodrow Barlow Sent: 01 June 2015 05:56 To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] PIC Micropchip Backend I am interested in developing a backend for the PIC microcontrollers. Specifically, I plan to write for the 8-bit MCUs, but would hopefully also support the 16 and 32 bit models (eventually). It is my understanding that a backend for PIC16 was previously a part of the project but was dropped in version 2.9. Is there any development on this front currently? Is there any interest in developing this for the current build of LLVM? Why was the original support dropped? Would it make a good basis for current support, or has the core software changed too much since then? I would appreciate hearing from anyone who has any insight. Thank you. - Woodrow Barlow -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150601/e661f097/attachment.html>
PIC backend was removed because it was written violating almost every LLVM programmer's guidelines and, even more, the authors refused to address review comments. So, it started to bitrot quite fast, noone from the community felt brave enough to maintain it and thus it was removed. Therefore it's stongly adviced not to use old PIC backend for any revival nor new development. Please consider developing new one from scratch "in proper way" :) On Mon, Jun 1, 2015 at 7:55 AM, Woodrow Barlow <wjbarlow at ncsu.edu> wrote:> I am interested in developing a backend for the PIC microcontrollers. > Specifically, I plan to write for the 8-bit MCUs, but would hopefully also > support the 16 and 32 bit models (eventually). It is my understanding that a > backend for PIC16 was previously a part of the project but was dropped in > version 2.9. Is there any development on this front currently? Is there any > interest in developing this for the current build of LLVM? Why was the > original support dropped? Would it make a good basis for current support, or > has the core software changed too much since then? > > I would appreciate hearing from anyone who has any insight. Thank you. > > - Woodrow Barlow > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University