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

Michael Liao michael.liao at intel.com
Thu Aug 30 09:16:09 PDT 2012


On Wed, 2012-08-29 at 16:28 -0700, Jakob Stoklund Olesen wrote:
> On Aug 29, 2012, at 4:25 PM, Michael Liao <michael.liao at intel.com> wrote:
> 
> > On Wed, 2012-08-29 at 16:22 -0700, Jakob Stoklund Olesen wrote:
> >> On Aug 28, 2012, at 2:35 PM, Michael Liao <michael.liao at intel.com> wrote:
> >> 
> >>> This patch resolves bit/bits value by resolving initializer value first
> >>> and get its bit value from the specified position by adding (or
> >>> promoting) getBits() to all Init(s) and removing resolveBitReference().
> >>> We unify bit/bits with other types and remove redundant logic.
> >> 
> >> Hi Michael,
> >> 
> >> Thanks for fixing this!
> >> 
> >> In the past I have noticed some pretty bad performance in TableGen because it is repeatedly evaluating an expression tree.
> >> 
> >> Does this patch help with that behavior? Did you measure the performance?
> > 
> > Not. Do u have any benchmark to measure?
> 
> Yeah, the LLVM targets ;-)
> 
> > I'd like to see whether or not the performance could be improved as well.
> 
> Running TableGen without a backend on X86.td or ARM.td should be a pretty good benchmark for lexing, parsing, and evaluation/expansion.

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.

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.

Yours
- Michael

> 
> /jakob
> 





More information about the llvm-commits mailing list