Carl Friedrich Bolz-Tereick pushed to branch branch/py3.8 at PyPy / pypy


Commits:
3810a2d2 by Carl Friedrich Bolz-Tereick at 2022-05-20T20:25:45+02:00
a new branch that is supposed to contain a really minimal version of 
record-known-result

--HG--
branch : record-known-result-2

- - - - -
4e418c89 by Carl Friedrich Bolz-Tereick at 2019-09-30T14:18:49+02:00
do a bit of cleanup, as I am about to touch this file

--HG--
branch : record-known-result-2

- - - - -
cdfb98d4 by Carl Friedrich Bolz-Tereick at 2019-09-30T16:20:40+02:00
implement a new hint jit.record_known_result

can be used to express general properties of elidable functions, eg two
functions being inverses of each other, or a function being idempotent.

--HG--
branch : record-known-result-2

- - - - -
73105138 by Carl Friedrich Bolz-Tereick at 2019-10-01T13:47:25+02:00
(cfbolz porting, yodada did the actual work) implement record_exact_value by
stealing the code from the record-exact-value branch. it's another
rlib.jit.record_* hint, this one can be used to tell the JIT about a known
constant value

--HG--
branch : record-known-result-2

- - - - -
68d1c6a7 by Carl Friedrich Bolz-Tereick at 2019-10-01T15:20:25+02:00
support for integer values in record_exact_value

--HG--
branch : record-known-result-2

- - - - -
f713df86 by Carl Friedrich Bolz-Tereick at 2019-10-18T13:52:35+02:00
missing canrun=True

--HG--
branch : record-known-result-2

- - - - -
f735ca68 by Armin Rigo at 2019-10-24T13:53:14+02:00
Test and fix annotation for record_exact_value()

--HG--
branch : record-known-result-2

- - - - -
5d57e05f by Carl Friedrich Bolz-Tereick at 2020-02-07T14:40:47+01:00
add missing op

--HG--
branch : record-known-result-2

- - - - -
934facff by Carl Friedrich Bolz-Tereick at 2019-10-01T10:52:18+02:00
another record_known_result: the content of W_UnicodeObject is known to be a 
valid utf8 string

--HG--
branch : record-known-result-2

- - - - -
23d29722 by Carl Friedrich Bolz-Tereick at 2019-10-18T10:00:27+02:00
tell the jit that the result of str.(r)find is always smaller than the length
of the string

--HG--
branch : record-known-result-2

- - - - -
37fc2605 by Carl Friedrich Bolz-Tereick at 2022-05-17T11:01:21+02:00
this part of sqlite3 is just wrong: converters are for converting the results
coming from the db to Python objects, not for converting the parameters. The
condition was useless, because the converters dict uses str keys, whereas the
lookup used a type as a key, always returning None (expensively)

- - - - -
a63fddf3 by Carl Friedrich Bolz-Tereick at 2022-05-19T17:28:31+02:00
very annoying, fix test that runs out of stack space (obscurely)

- - - - -
965ec925 by Carl Friedrich Bolz-Tereick at 2022-05-20T20:53:49+02:00
fix test, add one for rfind

--HG--
branch : record-known-result-2

- - - - -
03881c74 by Carl Friedrich Bolz-Tereick at 2022-05-20T22:52:24+02:00
add a test_pypy_c test that now passes

--HG--
branch : record-known-result-2

- - - - -
b1363bdf by Carl Friedrich Bolz-Tereick at 2022-05-20T23:12:28+02:00
another one

--HG--
branch : record-known-result-2

- - - - -
972e03be by Carl Friedrich Bolz-Tereick at 2022-05-20T23:22:30+02:00
small improvement, don't even record exact values that are known to be 
tracers in the constant

--HG--
branch : record-known-result-2

- - - - -
a3c8a5d8 by Carl Friedrich Bolz-Tereick at 2022-05-21T10:46:23+02:00
add a docstring

--HG--
branch : record-known-result-2

- - - - -
2a356375 by Carl Friedrich Bolz-Tereick at 2022-05-21T10:53:41+02:00
merge record-known-result-2: adds two new hints to rlib.jit

- record_exact_value(var, const) tells the JIT that the box var must contain
  the value const.

- record_known_result(result, func, *args) is a way to encode knowledge about
  the result of elidable functions. the hint means that the JIT can assume that
  if func(*args) will be called later, the outcome is 'result'

  typical usecases of this are: you can express this way that functions are
  inverses of each other, or that a function is idempotent.

Both hints need to be used very carefully, because getting them wrong can
really lead to miscompilation and crashes. They are only used in two places
right now (but much more are possible that I want to add successively later):

- record_exact_value is used in rpython to express that string.find(x) <
  len(string) by writing record_exact_value(res < len(string), True). This
  means the bounds check can be removed if the resulting position is used to
  index into the string.

- record_known_result is used when reading the ._utf8 string out of a
  W_UnicodeObject to tell the JIT that it is indeed a valid utf-8 encoding. So
  if it is re-decoded later, this turns into a no-op.

- - - - -
ab597702 by Carl Friedrich Bolz-Tereick at 2022-05-21T11:36:56+02:00
fix and unify the error paths

- - - - -
d78e8350 by Carl Friedrich Bolz-Tereick at 2022-05-21T13:58:11+02:00
merge default

--HG--
branch : py3.8

- - - - -


22 changed files:

- lib_pypy/_sqlite3.py
- pypy/module/pypyjit/test_pypy_c/test_string.py
- pypy/objspace/std/unicodeobject.py
- rpython/jit/codewriter/jtransform.py
- rpython/jit/metainterp/blackhole.py
- rpython/jit/metainterp/executor.py
- rpython/jit/metainterp/optimizeopt/pure.py
- rpython/jit/metainterp/optimizeopt/rewrite.py
- rpython/jit/metainterp/optimizeopt/simplify.py
- rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
- rpython/jit/metainterp/pyjitpl.py
- rpython/jit/metainterp/resoperation.py
- rpython/jit/metainterp/test/test_ajit.py
- rpython/jit/metainterp/test/test_recursive.py
- rpython/jit/metainterp/test/test_string.py
- rpython/rlib/jit.py
- rpython/rlib/test/test_jit.py
- rpython/rtyper/llinterp.py
- rpython/rtyper/lltypesystem/lloperation.py
- rpython/rtyper/lltypesystem/opimpl.py
- rpython/rtyper/lltypesystem/rstr.py
- rpython/translator/c/src/support.h


View it on Heptapod: 
https://foss.heptapod.net/pypy/pypy/-/compare/71a69e6a9ff3effb33fa0a5f1163d34abcb501b9...d78e8350e0a9fae959ddfe688e733d674ee67d99

-- 
View it on Heptapod: 
https://foss.heptapod.net/pypy/pypy/-/compare/71a69e6a9ff3effb33fa0a5f1163d34abcb501b9...d78e8350e0a9fae959ddfe688e733d674ee67d99
You're receiving this email because of your account on foss.heptapod.net.


_______________________________________________
pypy-commit mailing list -- pypy-commit@python.org
To unsubscribe send an email to pypy-commit-le...@python.org
https://mail.python.org/mailman3/lists/pypy-commit.python.org/
Member address: arch...@mail-archive.com

Reply via email to