Revision c3861f5c7371fea2fc5d20404a7f77c927bbd61b authored by Shuhei Kadowaki on 14 August 2021, 12:49:21 UTC, committed by Shuhei Kadowaki on 23 August 2021, 15:09:13 UTC
Built on top of #41882, this PR sorts out the constant-prop' interface
yet more, particularly generalizes `force_const_prop` to `const_prop_config`
so that it can turn on and off each heuristic.

The main motivation here is, in #41882, we want to force const-prop' on
`setproperty` even when its return type is already `Const` for the sake
of succeeding inlining, by skipping all the `const_prop_xxx_heuristic` checks.
But I still found we want to apply `const_prop_entry_heuristic` to
`getproperty`, because if we already know very accurate result for a
`getproperty` call, usually there is really no motivation for constant-prop', e.g.:
```julia
struct FZero end
Base.getproperty(::FZero, ::Symbol) = 0.0
getproperty(FZero(), :val) # const-prop' doesn't need to happen here
```

Now `force_const_prop(...) -> force::Bool` is refactored to
`const_prop_config(...) -> config::UInt8`, which can turn on and off
each heuristic based on the value of `config`.

I also included another refactoring that inlines `const_prop_rettype_heuristic`
into `const_prop_argument_heuristic`, because they really seem tightly coupled.
1 parent e1e4986
History
File Mode Size
clangsa
flisp
jsvm-emscripten
support
.gitignore -rw-r--r-- 346 bytes
APInt-C.cpp -rw-r--r-- 15.2 KB
APInt-C.h -rw-r--r-- 5.1 KB
Makefile -rw-r--r-- 19.7 KB
abi_aarch64.cpp -rw-r--r-- 15.3 KB
abi_arm.cpp -rw-r--r-- 9.2 KB
abi_llvm.cpp -rw-r--r-- 2.4 KB
abi_ppc64le.cpp -rw-r--r-- 5.8 KB
abi_win32.cpp -rw-r--r-- 2.9 KB
abi_win64.cpp -rw-r--r-- 3.0 KB
abi_x86.cpp -rw-r--r-- 3.3 KB
abi_x86_64.cpp -rw-r--r-- 8.4 KB
anticodegen.c -rw-r--r-- 2.8 KB
aotcompile.cpp -rw-r--r-- 37.2 KB
array.c -rw-r--r-- 45.1 KB
ast.c -rw-r--r-- 49.9 KB
ast.scm -rw-r--r-- 20.8 KB
atomics.h -rw-r--r-- 6.7 KB
bin2hex.scm -rw-r--r-- 388 bytes
builtin_proto.h -rw-r--r-- 1.5 KB
builtins.c -rw-r--r-- 68.6 KB
ccall.cpp -rw-r--r-- 80.9 KB
ccalltest.c -rw-r--r-- 24.7 KB
cgmemmgr.cpp -rw-r--r-- 29.7 KB
cgutils.cpp -rw-r--r-- 144.6 KB
codegen.cpp -rw-r--r-- 350.6 KB
codegen_shared.h -rw-r--r-- 1.9 KB
common_symbols1.inc -rw-r--r-- 2.1 KB
common_symbols2.inc -rw-r--r-- 5.7 KB
crc32c-tables.c -rw-r--r-- 43.4 KB
crc32c.c -rw-r--r-- 19.8 KB
datatype.c -rw-r--r-- 64.8 KB
debuginfo.cpp -rw-r--r-- 61.2 KB
debuginfo.h -rw-r--r-- 682 bytes
disasm.cpp -rw-r--r-- 45.5 KB
dlload.c -rw-r--r-- 11.8 KB
dump.c -rw-r--r-- 108.7 KB
features_aarch32.h -rw-r--r-- 1.1 KB
features_aarch64.h -rw-r--r-- 4.6 KB
features_x86.h -rw-r--r-- 3.9 KB
file_constants.h -rw-r--r-- 708 bytes
gc-debug.c -rw-r--r-- 46.9 KB
gc-pages.c -rw-r--r-- 13.1 KB
gc-stacks.c -rw-r--r-- 7.7 KB
gc.c -rw-r--r-- 140.3 KB
gc.h -rw-r--r-- 22.4 KB
gen_sysimg_symtab.jl -rw-r--r-- 2.0 KB
getopt.c -rw-r--r-- 4.3 KB
getopt.h -rw-r--r-- 1.8 KB
gf.c -rw-r--r-- 130.8 KB
iddict.c -rw-r--r-- 5.7 KB
init.c -rw-r--r-- 29.2 KB
interpreter.c -rw-r--r-- 29.8 KB
intrinsics.cpp -rw-r--r-- 68.7 KB
intrinsics.h -rw-r--r-- 3.1 KB
ircode.c -rw-r--r-- 31.8 KB
jitlayers.cpp -rw-r--r-- 42.1 KB
jitlayers.h -rw-r--r-- 8.5 KB
jl_exported_data.inc -rw-r--r-- 3.5 KB
jl_exported_funcs.inc -rw-r--r-- 15.1 KB
jl_uv.c -rw-r--r-- 28.1 KB
jlapi.c -rw-r--r-- 19.0 KB
jlfrontend.scm -rw-r--r-- 9.4 KB
jloptions.c -rw-r--r-- 30.2 KB
jltypes.c -rw-r--r-- 100.6 KB
julia-parser.scm -rw-r--r-- 109.4 KB
julia-syntax.scm -rw-r--r-- 221.9 KB
julia.expmap -rw-r--r-- 846 bytes
julia.h -rw-r--r-- 92.3 KB
julia_assert.h -rw-r--r-- 1.0 KB
julia_fasttls.h -rw-r--r-- 1.6 KB
julia_gcext.h -rw-r--r-- 6.6 KB
julia_internal.h -rw-r--r-- 61.1 KB
julia_threads.h -rw-r--r-- 12.3 KB
llvm-alloc-opt.cpp -rw-r--r-- 54.4 KB
llvm-demote-float16.cpp -rw-r--r-- 5.1 KB
llvm-final-gc-lowering.cpp -rw-r--r-- 11.5 KB
llvm-gc-invariant-verifier.cpp -rw-r--r-- 7.2 KB
llvm-julia-licm.cpp -rw-r--r-- 5.0 KB
llvm-late-gc-lowering.cpp -rw-r--r-- 114.6 KB
llvm-lower-handlers.cpp -rw-r--r-- 8.6 KB
llvm-muladd.cpp -rw-r--r-- 3.0 KB
llvm-multiversioning.cpp -rw-r--r-- 38.5 KB
llvm-pass-helpers.cpp -rw-r--r-- 9.5 KB
llvm-pass-helpers.h -rw-r--r-- 5.4 KB
llvm-propagate-addrspaces.cpp -rw-r--r-- 11.6 KB
llvm-ptls.cpp -rw-r--r-- 12.4 KB
llvm-remove-addrspaces.cpp -rw-r--r-- 14.9 KB
llvm-remove-ni.cpp -rw-r--r-- 1.2 KB
llvm-simdloop.cpp -rw-r--r-- 8.7 KB
llvm-version.h -rw-r--r-- 891 bytes
llvmcalltest.cpp -rw-r--r-- 1.9 KB
locks.h -rw-r--r-- 4.2 KB
macroexpand.scm -rw-r--r-- 25.5 KB
match.scm -rw-r--r-- 9.8 KB
method.c -rw-r--r-- 36.9 KB
mk_julia_flisp_boot.scm -rw-r--r-- 137 bytes
module.c -rw-r--r-- 29.3 KB
opaque_closure.c -rw-r--r-- 3.2 KB
options.h -rw-r--r-- 5.6 KB
partr.c -rw-r--r-- 17.1 KB
precompile.c -rw-r--r-- 14.6 KB
processor.cpp -rw-r--r-- 26.8 KB
processor.h -rw-r--r-- 9.7 KB
processor_arm.cpp -rw-r--r-- 65.0 KB
processor_fallback.cpp -rw-r--r-- 4.6 KB
processor_x86.cpp -rw-r--r-- 39.3 KB
rtutils.c -rw-r--r-- 46.2 KB
runtime_ccall.cpp -rw-r--r-- 10.7 KB
runtime_intrinsics.c -rw-r--r-- 40.0 KB
safepoint.c -rw-r--r-- 6.9 KB
serialize.h -rw-r--r-- 3.1 KB
signal-handling.c -rw-r--r-- 11.7 KB
signals-mach.c -rw-r--r-- 23.0 KB
signals-unix.c -rw-r--r-- 29.3 KB
signals-win.c -rw-r--r-- 17.0 KB
simplevector.c -rw-r--r-- 2.9 KB
smallintset.c -rw-r--r-- 5.5 KB
stackwalk.c -rw-r--r-- 28.3 KB
staticdata.c -rw-r--r-- 69.6 KB
subtype.c -rw-r--r-- 142.9 KB
symbol.c -rw-r--r-- 5.0 KB
sys.c -rw-r--r-- 22.2 KB
task.c -rw-r--r-- 43.2 KB
threading.c -rw-r--r-- 16.5 KB
threading.h -rw-r--r-- 684 bytes
timing.c -rw-r--r-- 1.8 KB
timing.h -rw-r--r-- 4.3 KB
toplevel.c -rw-r--r-- 38.6 KB
typemap.c -rw-r--r-- 52.7 KB
uprobes.d -rw-r--r-- 666 bytes
utils.scm -rw-r--r-- 3.0 KB
uv_constants.h -rw-r--r-- 783 bytes

back to top