[LLVMdev] LLVM IR Type System Rewrite

Chris Lattner clattner at apple.com
Sat Feb 26 16:23:50 PST 2011


On Feb 26, 2011, at 2:35 PM, Renato Golin wrote:

> On 26 February 2011 21:25, Chris Lattner <clattner at apple.com> wrote:
>> Several people have been proding me to write up my thoughts on how to fix the IR  type system for LLVM 3.0.  Here are some (fairly stream of conscious) thoughts on the matter:
>> http://nondot.org/sabre/LLVMNotes/TypeSystemRewrite.txt
> 
> Hi Chris,
> 
> I don't see such a bad problem with PATypeHolder, but I get what you
> say about the type refinement.
> 
> In the end, the logic is the same. You hold the type in a temporary
> state, build it as you go and mark it as "complete" when you finish.
> If you use type holders or the types themselves, it doesn't matter, as
> long as there is a way to mark them as complete. In the end, you still
> need to reject incomplete types on validation.
> 
> For IR readability, I welcome types being handled by name. This has
> been a bit of a nuisance, but again, nothing terrible.

Right, I don't see either as a showstopper.  The top things for me personally are getType() being slow, and type refinement being slow.

> Since you're refactoring types, how about a quick detour to see if
> it's possible to include unions and bitfields in the IR as well? I'm
> not saying to write a full-blown spec, but would be good at least to
> consider, so when someone finally have time to implement them, it's
> not impossible... I think there are plenty of people in this list,
> from different backgrounds and languages, that would welcome it.

These are quite orthogonal from the changes proposed.  I think that unions are well understood (we just need someone who cares enough about non-C languages to make it happen).  I don't think that bitfields should be in IR.

-Chris



More information about the llvm-dev mailing list