The output of TableGen (intrinsics.gen) seems a bit too clunky specifically the switching parts (input the string, output the enum). Moreover, the code makes MSVC barf due to its nesting limit which even applices to if-else statements. One one hand, gperf (http://www.gnu.org/software/gperf/manual/gperf.html) offers a way to map strings to records without much difficulty (and it does its job efficiently). My point is, are there plans to utilize gperf for table generation? -- (<_<)(>_>)(>_<)(<.<)(>.>)(>.<) Life is too short for dial-up.
Hi Wilhansen,> The output of TableGen (intrinsics.gen) seems a bit too clunky > specifically the switching parts (input the string, output the enum). > Moreover, the code makes MSVC barf due to its nesting limit which even > applices to if-else statements.Does introducing gotos into the generated code help as a temporary workaround for MSVC? Cheers, Ralph.
I believe that some of this will be alleviated by switching to a Trie data structure, though Anton would know for sure. -- Christopher Lamb On Jan 1, 2008, at 3:51 AM, Wilhansen Li wrote:> The output of TableGen (intrinsics.gen) seems a bit too clunky > specifically the switching parts (input the string, output the enum). > Moreover, the code makes MSVC barf due to its nesting limit which even > applices to if-else statements. > > One one hand, gperf > (http://www.gnu.org/software/gperf/manual/gperf.html) offers a way to > map strings to records without much difficulty (and it does its job > efficiently). > > My point is, are there plans to utilize gperf for table generation? > -- > (<_<)(>_>)(>_<)(<.<)(>.>)(>.<) > Life is too short for dial-up. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080101/c3a1ea2c/attachment.html>
On Jan 1, 2008, at 1:51 AM, Wilhansen Li wrote:> The output of TableGen (intrinsics.gen) seems a bit too clunky > specifically the switching parts (input the string, output the enum). > Moreover, the code makes MSVC barf due to its nesting limit which even > applices to if-else statements.Right, fixing the VC++ issue is straight-forward. I will do it in the next couple of days if noone beats me to it.> One one hand, gperf > (http://www.gnu.org/software/gperf/manual/gperf.html) offers a way to > map strings to records without much difficulty (and it does its job > efficiently). > > My point is, are there plans to utilize gperf for table generation?Not that I know of. Anton is working on a better and more aggressive implementation of this code in question though, -Chris
On Jan 1, 2008, at 1:51 AM, Wilhansen Li wrote:> The output of TableGen (intrinsics.gen) seems a bit too clunky > specifically the switching parts (input the string, output the enum). > Moreover, the code makes MSVC barf due to its nesting limit which even > applices to if-else statements. > > One one hand, gperf > (http://www.gnu.org/software/gperf/manual/gperf.html) offers a way to > map strings to records without much difficulty (and it does its job > efficiently). > > My point is, are there plans to utilize gperf for table generation?There isn't any plan to do so. I agree the output of TableGen can be much improved. But this hasn't been a high priority issue. If you have an interest in improving this, please do! But I would prefer the improvement be made in TableGen that would not require another external tool. Thanks! Evan> > -- > (<_<)(>_>)(>_<)(<.<)(>.>)(>.<) > Life is too short for dial-up. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On Tue, 1 Jan 2008, Wilhansen Li wrote:> The output of TableGen (intrinsics.gen) seems a bit too clunky > specifically the switching parts (input the string, output the enum). > Moreover, the code makes MSVC barf due to its nesting limit which even > applices to if-else statements.This should be fixed now, please verify, thanks! -Chris -- http://nondot.org/sabre/ http://llvm.org/
FYI, gperf is a very good perfect hash utility written originally by Doug Schmidt (of ACE fame). I used it in XPS for speeding up XML parsing by hashing all the element and attribute names. Unfortunately, its a code generator, which we're trying to get rid of in LLVM. Still, I recommend the tool highly. Reid. On Tue, 1 Jan 2008 13:04:57 -0800 Chris Lattner <sabre at nondot.org> wrote:> >On Jan 1, 2008, at 1:51 AM, Wilhansen Li wrote: > >> The output of TableGen (intrinsics.gen) seems a bit too clunky >> specifically the switching parts (input the string, output the enum). >> Moreover, the code makes MSVC barf due to its nesting limit which even >> applices to if-else statements. > >Right, fixing the VC++ issue is straight-forward. I will do it in the >next couple of days if noone beats me to it. > > >> One one hand, gperf >> (http://www.gnu.org/software/gperf/manual/gperf.html) offers a way to >> map strings to records without much difficulty (and it does its job >> efficiently). >> >> My point is, are there plans to utilize gperf for table generation? > >Not that I know of. Anton is working on a better and more aggressive >implementation of this code in question though, > >-Chris > >_______________________________________________ >LLVM Developers mailing list >LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
The newer code that TableGen produces is indeed lower however, MSVC still throws the same error messages (and moreover, I don't think they're fixing it anytime soon.. I'll try to re-open this issue to them). Also, it seems that the new code produces an extraneous "if (0);" statement before each of the else-if chains. Normally, compilers would (and should) just optimize them away but it still counts agains MSVC's ``nesting limit''. On 1/3/08, Chris Lattner <sabre at nondot.org> wrote:> On Tue, 1 Jan 2008, Wilhansen Li wrote: > > The output of TableGen (intrinsics.gen) seems a bit too clunky > > specifically the switching parts (input the string, output the enum). > > Moreover, the code makes MSVC barf due to its nesting limit which even > > applices to if-else statements. > > This should be fixed now, please verify, thanks! > > -Chris > > -- > http://nondot.org/sabre/ > http://llvm.org/ > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- (<_<)(>_>)(>_<)(<.<)(>.>)(>.<) Life is too short for dial-up.