[LLVMdev] PIC16 removal details

Dan Gohman gohman at apple.com
Wed Sep 21 14:53:20 PDT 2011


On Sep 20, 2011, at 10:59 PM, Matthew Hilt wrote:

> I've been looking closely at LLVM as a means to developing a new toolchain for an MCU core of very similar architecture.  To that end, the once included PIC16 backend might be a valuable reference.  I found a message in April of this year that indicated it had been dropped from new releases however, and that were it to be resumed "it will be largely a rewrite".
> 
> I'm wondering if I can get some details as to why it was dropped firstly and also, why would it be 'largely a rewrite' if it were resumed?  Thanks in advance.

LLVM is designed for "normal" architectures. The further from
approximately the intersection of x86 and ARM, the more it takes to
use LLVM effectively. PIC16, we learned, is well out there, from
LLVM's perspective.

As one example, LLVM is built to optimize for machines with numerous
general-purpose registers. It's a stretch to even say that PIC16 has
a single general-purpose register. The PIC16 backend developers
asked for ways to prevent LLVM from promoting variables from memory
into registers, because it was pessimizing code for PIC16. However,
LLVM can't do that without also shutting down large parts of itself,
because of the pervasive assumption that registers are where the
action is.

Dan




More information about the llvm-dev mailing list