For my experiment on loop fusion with SPy, I need to get a nice, human-readable redshift output.
First, it should be possible to ask for a simplified short version of the redshift output. For the loop fusion demo, I used (https://github.com/paugier/spy-demos/blob/loop-fusion/loop-fusion/simplify_rs_output.py):
# `name` is the file name without `.spy`.
for name, content in files.items():
files[name] = (
content.replace(name + "::", "")
.replace("::Self", "")
.replace(str(Path.home()), "~")
)
Self is the name of the concrete types created in type factories. We don't need ndarray[f64, 3]::Self, especially when it's repeated several times. This is about the representation of generic function returning a type. A simple solution would be to treat the word Self as special and not display "::Self" in this case.
Second, the redshift output should be formatted to avoid very long lines to obtain something like this rather that the one-line version:
`unsafe::gc_ptr[f64]::getitem_byval`(
`unsafe::ptr_getfield_byval[unsafe::gc_ptr[f64]]`(
`ndarray[f64]::__get___ll____`(
`LazyAdd[f64, ndarray[f64], ndarray[f64]]::__get_left__`(
`LazyAdd[f64, LazyAdd[f64, ndarray[f64], ndarray[f64]], ndarray[f64]]::__get_left__`(expr))), 'items', 8), i)
+ `unsafe::gc_ptr[f64]::getitem_byval`(
`unsafe::ptr_getfield_byval[unsafe::gc_ptr[f64]]`(
`ndarray[f64]::__get___ll____`(
`LazyAdd[f64, ndarray[f64], ndarray[f64]]::__get_right__`(
`LazyAdd[f64, LazyAdd[f64, ndarray[f64], ndarray[f64]], ndarray[f64]]::__get_left__`(expr))), 'items', 8), i)
+ `unsafe::gc_ptr[f64]::getitem_byval`(
`unsafe::ptr_getfield_byval[unsafe::gc_ptr[f64]]`(
`ndarray[f64]::__get___ll____`(
`LazyAdd[f64, LazyAdd[f64, ndarray[f64], ndarray[f64]], ndarray[f64]]::__get_right__`(expr)), 'items', 8), i)
For my experiment on loop fusion with SPy, I need to get a nice, human-readable redshift output.
First, it should be possible to ask for a simplified short version of the redshift output. For the loop fusion demo, I used (https://github.com/paugier/spy-demos/blob/loop-fusion/loop-fusion/simplify_rs_output.py):
Selfis the name of the concrete types created in type factories. We don't needndarray[f64, 3]::Self, especially when it's repeated several times. This is about the representation of generic function returning a type. A simple solution would be to treat the wordSelfas special and not display "::Self" in this case.Second, the redshift output should be formatted to avoid very long lines to obtain something like this rather that the one-line version: