[LLVMdev] LLVM IR Type System Rewrite

Renato Golin rengolin at systemcall.org
Sat Feb 26 14:35:43 PST 2011


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.

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.

I can send the first round of proposals, but you guys will have to
help me with the back-end implementation, as it's not my strong side.

cheers,
--renato




More information about the llvm-dev mailing list