Revision c22889e76cb9b7fd8a4710d9bf53e827aaa907e4 authored by Shuhei Kadowaki on 24 August 2021, 04:21:29 UTC, committed by Shuhei Kadowaki on 26 October 2021, 14:45:33 UTC
Currently our constant-prop' heuristics work in the following way:
1. `const_prop_entry_heuristic`
2. `const_prop_argument_heuristic` & `const_prop_rettype_heuristic`
3. `force_const_prop` custom heuristic & `!const_prop_function_heuristic`
4. `MethodInstance` specialization and `const_prop_methodinstance_heuristic`

This PR changes it so that the step 1. now works like:

1. `force_const_prop` custom heuristic & `const_prop_entry_heuristic`

and the steps 2., 3. and 4. don't change

This change particularly allows us to more forcibly constant-propagate
for `getproperty` and `setproperty!`, and inline them more, e.g.:
```julia
mutable struct Foo
    val
    _::Int
end

function setter(xs)
    for x in xs
        x.val = nothing # `setproperty!` can be inlined with this PR
    end
end
```

It might be useful because now we can intervene into the constant-prop'
heuristic in a more reliable way with the `aggressive_constprop` interface.

I did the simple benchmark below, and it looks like this change doesn't
cause the latency problem for this particular example:
```zsh
~/julia master aviatesk@amdci2 6s
❯ ./usr/bin/julia -e '@time using Plots; @time plot(rand(10,3))'
  3.708500 seconds (7.28 M allocations: 506.128 MiB, 3.45% gc time, 1.13% compilation time)
  2.817794 seconds (3.45 M allocations: 195.127 MiB, 7.84% gc time, 53.76% compilation time)

~/julia avi/forceconstantprop aviatesk@amdci2 6s
❯ ./usr/bin/julia -e '@time using Plots; @time plot(rand(10,3))'
  3.622109 seconds (7.02 M allocations: 481.710 MiB, 4.19% gc time, 1.17% compilation time)
  2.863419 seconds (3.44 M allocations: 194.210 MiB, 8.02% gc time, 53.53% compilation time)
```
1 parent da71d29
History
File Mode Size
compiler
docs
ryu
special
strings
.gitignore -rw-r--r-- 154 bytes
Base.jl -rw-r--r-- 14.5 KB
Enums.jl -rw-r--r-- 6.9 KB
Makefile -rw-r--r-- 10.8 KB
abstractarray.jl -rw-r--r-- 96.7 KB
abstractarraymath.jl -rw-r--r-- 12.6 KB
abstractdict.jl -rw-r--r-- 15.2 KB
abstractset.jl -rw-r--r-- 9.8 KB
accumulate.jl -rw-r--r-- 12.0 KB
array.jl -rw-r--r-- 63.0 KB
arraymath.jl -rw-r--r-- 6.3 KB
arrayshow.jl -rw-r--r-- 23.1 KB
asyncevent.jl -rw-r--r-- 8.6 KB
asyncmap.jl -rw-r--r-- 13.6 KB
atomics.jl -rw-r--r-- 12.5 KB
baseext.jl -rw-r--r-- 2.6 KB
binaryplatforms.jl -rw-r--r-- 36.8 KB
bitarray.jl -rw-r--r-- 50.2 KB
bitset.jl -rw-r--r-- 12.9 KB
bool.jl -rw-r--r-- 3.6 KB
boot.jl -rw-r--r-- 28.0 KB
broadcast.jl -rw-r--r-- 59.0 KB
c.jl -rw-r--r-- 22.7 KB
cartesian.jl -rw-r--r-- 11.5 KB
channels.jl -rw-r--r-- 12.9 KB
char.jl -rw-r--r-- 12.2 KB
checked.jl -rw-r--r-- 11.8 KB
client.jl -rw-r--r-- 17.6 KB
cmd.jl -rw-r--r-- 15.3 KB
combinatorics.jl -rw-r--r-- 8.4 KB
complex.jl -rw-r--r-- 29.3 KB
condition.jl -rw-r--r-- 6.9 KB
coreio.jl -rw-r--r-- 1.0 KB
cpuid.jl -rw-r--r-- 4.8 KB
ctypes.jl -rw-r--r-- 1.7 KB
deepcopy.jl -rw-r--r-- 4.1 KB
deprecated.jl -rw-r--r-- 10.7 KB
dict.jl -rw-r--r-- 21.0 KB
div.jl -rw-r--r-- 9.8 KB
download.jl -rw-r--r-- 989 bytes
env.jl -rw-r--r-- 6.6 KB
error.jl -rw-r--r-- 10.3 KB
errorshow.jl -rw-r--r-- 33.1 KB
essentials.jl -rw-r--r-- 25.2 KB
experimental.jl -rw-r--r-- 9.3 KB
exports.jl -rw-r--r-- 13.3 KB
expr.jl -rw-r--r-- 19.7 KB
fastmath.jl -rw-r--r-- 13.0 KB
file.jl -rw-r--r-- 34.4 KB
filesystem.jl -rw-r--r-- 7.7 KB
float.jl -rw-r--r-- 30.7 KB
floatfuncs.jl -rw-r--r-- 12.4 KB
gcutils.jl -rw-r--r-- 6.0 KB
generator.jl -rw-r--r-- 3.9 KB
gmp.jl -rw-r--r-- 33.0 KB
hashing.jl -rw-r--r-- 3.1 KB
iddict.jl -rw-r--r-- 5.7 KB
idset.jl -rw-r--r-- 1.1 KB
indices.jl -rw-r--r-- 18.5 KB
initdefs.jl -rw-r--r-- 13.2 KB
int.jl -rw-r--r-- 28.3 KB
intfuncs.jl -rw-r--r-- 26.8 KB
io.jl -rw-r--r-- 34.2 KB
iobuffer.jl -rw-r--r-- 16.7 KB
iostream.jl -rw-r--r-- 17.2 KB
irrationals.jl -rw-r--r-- 7.6 KB
iterators.jl -rw-r--r-- 39.5 KB
libc.jl -rw-r--r-- 14.9 KB
libdl.jl -rw-r--r-- 9.5 KB
libuv.jl -rw-r--r-- 4.5 KB
linked_list.jl -rw-r--r-- 4.2 KB
loading.jl -rw-r--r-- 72.6 KB
lock.jl -rw-r--r-- 9.0 KB
locks-mt.jl -rw-r--r-- 3.1 KB
logging.jl -rw-r--r-- 22.2 KB
math.jl -rw-r--r-- 31.9 KB
mathconstants.jl -rw-r--r-- 2.3 KB
meta.jl -rw-r--r-- 15.4 KB
methodshow.jl -rw-r--r-- 13.4 KB
missing.jl -rw-r--r-- 13.6 KB
mpfr.jl -rw-r--r-- 39.7 KB
multidimensional.jl -rw-r--r-- 69.3 KB
multimedia.jl -rw-r--r-- 15.5 KB
multinverses.jl -rw-r--r-- 5.6 KB
namedtuple.jl -rw-r--r-- 13.2 KB
ntuple.jl -rw-r--r-- 2.7 KB
number.jl -rw-r--r-- 7.5 KB
opaque_closure.jl -rw-r--r-- 507 bytes
operators.jl -rw-r--r-- 34.1 KB
options.jl -rw-r--r-- 2.3 KB
ordering.jl -rw-r--r-- 5.0 KB
osutils.jl -rw-r--r-- 1.2 KB
pair.jl -rw-r--r-- 1.7 KB
parse.jl -rw-r--r-- 13.9 KB
path.jl -rw-r--r-- 16.8 KB
pcre.jl -rw-r--r-- 8.4 KB
permuteddimsarray.jl -rw-r--r-- 8.6 KB
pkgid.jl -rw-r--r-- 1.2 KB
pointer.jl -rw-r--r-- 6.5 KB
process.jl -rw-r--r-- 20.7 KB
promotion.jl -rw-r--r-- 14.4 KB
range.jl -rw-r--r-- 49.9 KB
rational.jl -rw-r--r-- 16.7 KB
reduce.jl -rw-r--r-- 33.3 KB
reducedim.jl -rw-r--r-- 29.0 KB
reflection.jl -rw-r--r-- 51.8 KB
refpointer.jl -rw-r--r-- 7.4 KB
refvalue.jl -rw-r--r-- 1.7 KB
regex.jl -rw-r--r-- 26.2 KB
reinterpretarray.jl -rw-r--r-- 27.8 KB
reshapedarray.jl -rw-r--r-- 11.4 KB
rounding.jl -rw-r--r-- 7.1 KB
secretbuffer.jl -rw-r--r-- 5.5 KB
set.jl -rw-r--r-- 20.1 KB
shell.jl -rw-r--r-- 14.8 KB
show.jl -rw-r--r-- 102.3 KB
simdloop.jl -rw-r--r-- 5.4 KB
some.jl -rw-r--r-- 3.3 KB
sort.jl -rw-r--r-- 33.5 KB
stacktraces.jl -rw-r--r-- 9.8 KB
stat.jl -rw-r--r-- 12.7 KB
stream.jl -rw-r--r-- 44.3 KB
subarray.jl -rw-r--r-- 19.2 KB
summarysize.jl -rw-r--r-- 5.9 KB
sysimg.jl -rw-r--r-- 4.0 KB
sysinfo.jl -rw-r--r-- 15.5 KB
task.jl -rw-r--r-- 23.5 KB
threadcall.jl -rw-r--r-- 4.0 KB
threadingconstructs.jl -rw-r--r-- 6.3 KB
threads.jl -rw-r--r-- 850 bytes
threads_overloads.jl -rw-r--r-- 2.3 KB
timing.jl -rw-r--r-- 12.6 KB
toml_parser.jl -rw-r--r-- 35.9 KB
traits.jl -rw-r--r-- 2.4 KB
ttyhascolor.jl -rw-r--r-- 967 bytes
tuple.jl -rw-r--r-- 15.7 KB
twiceprecision.jl -rw-r--r-- 28.6 KB
util.jl -rw-r--r-- 24.9 KB
uuid.jl -rw-r--r-- 3.2 KB
version.jl -rw-r--r-- 10.8 KB
version_git.sh -rw-r--r-- 2.9 KB
views.jl -rw-r--r-- 8.3 KB
weakkeydict.jl -rw-r--r-- 6.0 KB

back to top