[LLVMdev] TableGen: Requesting feedback for "TGContext"

Jim Grosbach grosbach at apple.com
Thu Oct 4 11:03:11 PDT 2012


On Oct 3, 2012, at 7:07 PM, Sean Silva <silvas at purdue.edu> wrote:

> Hi all, I'm sure that the last thing that you want to think about is
> TableGen's guts, but I'm pursuing a course in bringing TableGen up to
> snuff with the rest of LLVM.
> 
> Basically, I would like to introduce a "TGContext" class (by analogy
> with LLVMContext) to harbor a proper unique'd type system and BumpPtr
> allocate all of TableGen's data (RecTy's, Record's, Init's, etc). This
> change should have no effect on the TableGen backends, simply being a
> refactoring of the internals.
> 
> One huge bonus in particular from centralizing all of the memory
> allocation is that I plan to hack in a custom memory allocator (in a
> local branch) which distributes objects randomly in memory, which will
> definitively flush out *all* pointer-value-as-map-key non-determinism
> inside TableGen.
> 
> Does anybody have anything else they think should go into TGContext or
> any other responsibilities it should have? Or any feedback about the
> idea in general?
> 
> I'm also hoping that this change should loosen up some of the
> calcification that has accumulated on TableGen and get the ball
> rolling for transitioning dynamic_cast<> to dyn_cast<> and eliminating
> exceptions, along with general improvements in reliability and
> performance. Along the way I'm also hoping to pull together proper
> reference documentation for the language as it stands right now.

Huge +1. This is awesome.

Along the same lines as removing RTTI and exceptions is that TableGen could really use a StringRef'ization and more use of the ADT containers in general. That's pretty orthogonal to what you're proposing here, though, so certainly not required. Just something to keep in mind as you work through the code if you're in the mood for some incremental cleanup along the way.


-Jim
> 
> -- Sean Silva
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list