[llvm-commits] [PATCH] Rework bit/bits value resolving in tblgen

Michael Liao michael.liao at intel.com
Wed Sep 5 15:22:15 PDT 2012


Hi, Jakob

Here's the revised addressing the performance issue. This patch revises
BitsInit reference resolving by resolving VarBitInit's variable
reference first and getting bits from it, thus, reducing the overhead of
resolving VarBitInit(s) with the common variable. So far, the
performance is on par with the original one plus extra features and bug
fixes.

Here's the test result:
	w/o patch	with patch
X86	0.598s		0.596s
ARM	0.517s		0.516s

I added one hidden option '-skip-action' to skip the final dump to
measure only lexing/parsing/resolving performance:

	w/o patch	with patch
X86	0.414s		0.413s
ARM	0.354s		0.354s

(0001-add-skip-action-hidden-option.patch is the patch adding this
hidden option.)

The performance is on par with this patch. As previously bitref on !if
will convert IF on bits into bits of IF, I cannot see redundant
resolving due to bitref from the X86.td or ARM.td. I will dig into that
later.

Yours
- Michael


On Thu, 2012-08-30 at 09:46 -0700, Michael Liao wrote:
> On Thu, 2012-08-30 at 09:45 -0700, Jakob Stoklund Olesen wrote:
> > On Aug 30, 2012, at 9:16 AM, Michael Liao <michael.liao at intel.com> wrote:
> > 
> > > It makes tblgen runs slower. Here my test script
> > > 
> > >  time llvm-tblgen -I include -I lib/Target/X86 lib/Target/X86/X86.td
> > > -o /dev/null (or ARM)
> > > 
> > > for release build
> > >     w/o patch    with patch
> > > X86  0.584s        0.665s
> > > ARM  0.514s        0.623s
> > > 
> > > time is measured by selecting the middle one from 3 consecutive runs.
> > 
> > That's quite significant.
> > 
> > > VarBitInit reference may contributes the most as the way they are formed
> > > in the patch is 'getBit(Init, Bit)' and will result in more duplicated
> > > value resolving.
> > 
> > We already have way too much redundant resolving going on, and I think there is an opportunity to make TableGen a lot faster by fixing it.
> > 
> > Could I ask you to look at that? I'd rather not make it worse.
> 
> Sure, I will look into it to get better performance.
> 
> Yours
> - Michael
> 
> > 
> > /jakob
> > 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Re-work-bit-bits-value-resolving-in-tblgen.patch
Type: text/x-patch
Size: 30967 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120905/1e1fa7ed/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-skip-action-hidden-option.patch
Type: text/x-patch
Size: 1007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120905/1e1fa7ed/attachment-0001.bin>


More information about the llvm-commits mailing list