Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: llvm-re

Dec 17, 2009

  1. Ian McKellar

    Merge branch 'master' into llvm-re

    authored
  2. Ian McKellar

    use our own optimizer

    authored

Dec 16, 2009

  1. Fix attribute access optimization instrumentation.

    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@939 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    reid.kleckner authored
  2. More closely approximate correct dependencies in the Makefile. The mi…

    …ssing
    
    pieces I know of are:
     * When you change LLVM, you have to build twice for the Python bits that
       depend on LLVM to get rebuilt.
     * If you change an LLVM header that affects Python code, the Python won't get
       rebuilt at all.  We could fix that with -MM.
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@938 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored

Dec 15, 2009

  1. Ian McKellar

    move the optimizer call into REM

    authored
  2. Ian McKellar

    move function dumping into REM

    authored
  3. Ian McKellar

    create a singleton to hold globals

    authored
  4. Ian McKellar

    for DEBUG flag, dump LLVM IR on compile

    authored
  5. Ian McKellar

    Only dump the functions related to the RE, not the whole module.

    authored

Dec 14, 2009

  1. Merge r69040 from upstream CPython release26-maint branch.

    On Windows, use the Python 'Activation Context' when loading extensions
    to avoid problems loading the CRT from a private assembly.  Via
    http://bugs.python.org/issue4566.
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@934 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    collinw authored
  2. Fix loading python26.bc from drives other than C: (Issue 96)

    Split sys_path on the correct platform-specific delimiter
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@933 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    abbeyj authored

Dec 13, 2009

  1. Ian McKellar

    add SREONLY and LLVMONLY flags to control compilation

    authored

Dec 12, 2009

  1. Move all instrumentation output to stderr.

    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@931 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    collinw authored

Dec 11, 2009

  1. Ian McKellar

    Merge branch 'master' into llvm-re

    authored
  2. Ian McKellar

    fix stats counting

    authored

Dec 10, 2009

  1. Fix inlining after lazy bitcode loading. We were only inlining when

    the definition was visible, and lazy loading prevents the definition
    from being visible until it's explicitly loaded. Oops.
    
    Benchmark results from the fix:
    
    2to3:
    Min: 20.445278 -> 20.253266: 1.0095x faster
    Avg: 20.542084 -> 20.552485: 1.0005x slower
    Not significant
    Stddev: 0.08052 -> 0.25643: 3.1845x larger
    
    django:
    Min: 0.745576 -> 0.742656: 1.0039x faster
    Avg: 0.751970 -> 0.746155: 1.0078x faster
    Significant (t=4.812576, a=0.95)
    Stddev: 0.01079 -> 0.00544: 1.9849x smaller
    
    nbody:
    Min: 0.334529 -> 0.275597: 1.2138x faster
    Avg: 0.339909 -> 0.284750: 1.1937x faster
    Significant (t=25.589234, a=0.95)
    Stddev: 0.01229 -> 0.01771: 1.4412x larger
    
    slowpickle:
    Min: 0.495693 -> 0.458004: 1.0823x faster
    Avg: 0.508614 -> 0.470962: 1.0799x faster
    Significant (t=4.065056, a=0.95)
    Stddev: 0.06455 -> 0.06642: 1.0290x larger
    
    slowspitfire:
    Min: 0.505189 -> 0.472504: 1.0692x faster
    Avg: 0.509932 -> 0.478565: 1.0655x faster
    Significant (t=18.661524, a=0.95)
    Stddev: 0.00724 -> 0.01517: 2.0958x larger
    
    slowunpickle:
    Min: 0.237972 -> 0.213040: 1.1170x faster
    Avg: 0.247768 -> 0.221938: 1.1164x faster
    Significant (t=5.947074, a=0.95)
    Stddev: 0.03170 -> 0.02969: 1.0679x smaller
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@928 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored
  2. Ian McKellar

    Merge branch 'master' into llvm-re

    authored
  3. Ian McKellar

    support $PYTHONRE for customizing re compile behavior

    authored

Dec 08, 2009

  1. Ian McKellar

    Automatically switch between SRE and llvmre for heavily used REs

    authored
  2. Fix use of uninitialized memory observed in embedding application.

    Fixes a bug introduced in
    http://code.google.com/p/unladen-swallow/source/detail?r=894. Includes a
    regression test.
    
    Most PyMethodDef structs are allocated globally, and the compiler takes care of
    zeroing out uninitialized fields. Not so with malloc(), which causes problems
    for some embedding applications that don't memset() their memory. This has been
    observed in applications that heap-allocate PyMethodDefs and then set
    METH_NOARGS, which previously was #defined to METH_ARG_RANGE. This is arguably a
    problem in the application, but if it works with Python 2.6, it needs to work
    with Unladen Swallow.
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@925 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    collinw authored

Dec 07, 2009

  1. Restore #include lost during hg merge.

    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@924 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    reid.kleckner authored
  2. Optimize away _PyType_Lookup in LOAD_ATTR in the JITed code.

    To do this, we gather feedback about which types are used at LOAD_ATTR sites and
    cache the result of _PyType_Lookup at JIT compile time.
    
    In order to maintain correctness, we have to emit three guards: one to check
    that the code object has not been invalidate, one to check the type of the
    object performing the lookup, and one to check that the descriptor we've cached
    hasn't changed its type.
    
    We also need to listen for modifications to two types: the type we are caching
    against, and the type of the descriptor.  If the type changes, the descriptor
    object we cached and the tp_dictoffset may be invalidated.  If the descriptor
    type changes, its tp_descr_[gs]et methods may change, which we also cache.
    
    Although I have not done rigorous microbenchmarks to test this theory, I believe
    this optimization should drastically improve the performance of types that do
    not have a dictionary, ie builtin types and classes that define __slots__
    without a __dict__ slot.  If there is no dictionary, then the entire attribute
    access can be optimized to a direct call to the appropriate get or set
    descriptor.
    
    The JIT compiler has been instrumented to keep track of its decisions as it
    compiles opcodes.  Here is the sum of those values across all the benchmarks
    while running perf.py in rigorous mode:
    
    LOAD/STORE_ATTR optimization:
    Total opcodes: 1233
    Optimized opcodes: 595
    LOAD_ATTR opcodes: 1119
    Optimized LOAD_ATTR opcodes: 595
    STORE_ATTR opcodes: 114
    Optimized STORE_ATTR opcodes: 0
    No opt: no data: 312
    No opt: no mcache support: 24
    No opt: overrode getattr: 261
    No opt: polymorphic: 41
    No opt: non-string name: 0
    
    About half of the loads can be optimized.  Of the ones that cannot, half have no
    feedback data, and are therefore cold and unimportant for optimization.  Another
    significant portion have overrode tp_[gs]etattro.  My theory is that most of
    these are coming from old-style class objects, since they use a different
    version of tp_[gs]etattro.  Very few accesses are polymorphic, which is
    interesting, because it shows we should keep working on optimizing monomorphic
    code.  Finally, some objects do not yet support the method cache optimization,
    which is necessary for listening for type object modifications.
    
    Here are the performance results from perf.py in rigorous mode on a 2.67 GHz
    Core i7:
    
    Report on Linux muikyl 2.6.31-16-generic #52-Ubuntu SMP Thu Dec 3 22:07:16 UTC
    2009 x86_64 
    
    2to3:
    Min: 22.100000 -> 21.750000: 1.61% faster
    Avg: 22.526000 -> 22.558000: 0.14% slower
    Not significant
    Stddev: 0.46923 -> 0.59542: 21.19% larger
    
    django:
    Min: 0.598759 -> 0.582879: 2.72% faster
    Avg: 0.611388 -> 0.585029: 4.51% faster
    Significant (t=38.012520, a=0.95)
    Stddev: 0.00670 -> 0.00178: 276.00% smaller
    
    rietveld:
    Min: 0.390425 -> 0.377592: 3.40% faster
    Avg: 0.394880 -> 0.382011: 3.37% faster
    Significant (t=12.916469, a=0.95)
    Stddev: 0.00696 -> 0.00713: 2.41% larger
    
    slowpickle:
    Min: 0.392096 -> 0.366802: 6.90% faster
    Avg: 0.392894 -> 0.367696: 6.85% faster
    Significant (t=178.196720, a=0.95)
    Stddev: 0.00090 -> 0.00109: 17.22% larger
    
    slowspitfire:
    Min: 0.417448 -> 0.386655: 7.96% faster
    Avg: 0.426665 -> 0.388272: 9.89% faster
    Significant (t=44.430745, a=0.95)
    Stddev: 0.00772 -> 0.00389: 98.34% smaller
    
    slowunpickle:
    Min: 0.191562 -> 0.184019: 4.10% faster
    Avg: 0.192044 -> 0.184475: 4.10% faster
    Significant (t=78.227593, a=0.95)
    Stddev: 0.00066 -> 0.00071: 7.57% larger
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@923 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    reid.kleckner authored

Dec 06, 2009

  1. Update MSVC build for loading .bc file at runtime

    Also adds the new DeadGlobalElim files to the project file.
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@922 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    abbeyj authored

Dec 04, 2009

  1. Load bitcode lazily. LLVM's global optimizations tend to break lazy b…

    …itcode
    
    loading, so this patch copies globaldce into our tree and tweaks it to avoid
    deleting things the ModuleProvider needs.
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@919 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored
  2. Fix the unittests for libpython.bc. On Linux, python needs argv[0] to

    figure out that it's in the build directory, so this patch modifies
    the unittests' main() to pass that in.
    
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@917 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored

Dec 03, 2009

  1. Merge r89708 and r89715 from upstream LLVM to avoid a far-call

    assertion in emitFunctionStubAtAddr on x86-64.
    
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@915 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored
  2. Move the initial module to a .bc file. A future patch will load the m…

    …odule
    
    lazily. If installing the .bc file turns out to cause problems, it should be
    possible to embed it as a string inside the binary.
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@914 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored
  3. Fix a bug in unichr() introduced in r894.

    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@913 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    collinw authored

Dec 01, 2009

  1. Remove assertion about calls with too-big offsets now that all JIT ca…

    …lls on x86
    
    can jump as far as they need.
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@910 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored

Nov 24, 2009

  1. Fix printing co_llvm from compiled code objects.

    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@909 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored
  2. Update MSVC build for Stats.cc and new LLVM

    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@908 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    abbeyj authored

Nov 20, 2009

  1. Fix Unladen for LLVM r89410 merge.

    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@907 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored
  2. Merge LLVM+Clang at r89410 into Unladen Swallow.

    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@906 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    jyasskin authored
  3. Ian McKellar

    Merge branch 'master' into llvm-re

    authored
  4. Tag some more methods with METH_ARG_RANGE.

    Highlight:
    
    django:
    Min: 0.868683 -> 0.847636: 2.48% faster
    Avg: 0.874128 -> 0.854678: 2.28% faster
    Significant (t=23.333001, a=0.95)
    Stddev: 0.00617 -> 0.00561: 9.95% smaller
    
    Other benchmarks are performance-neutral.
    
    Patch by Alex Gaynor!
    
    
    git-svn-id: http://unladen-swallow.googlecode.com/svn/trunk@904 05521daa-c0b4-11dd-bb00-bd6ab96fe29a
    collinw authored
Something went wrong with that request. Please try again.