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
File | Mode | Size |
---|---|---|
.gitignore | -rw-r--r-- | 93 bytes |
LICENSE | -rw-r--r-- | 1.5 KB |
Makefile | -rw-r--r-- | 4.5 KB |
aliases.scm | -rw-r--r-- | 1.9 KB |
bootstrap.sh | -rwxr-xr-x | 352 bytes |
builtins.c | -rw-r--r-- | 11.5 KB |
color.lsp | -rw-r--r-- | 2.8 KB |
compiler.lsp | -rw-r--r-- | 25.6 KB |
cvalues.c | -rw-r--r-- | 44.8 KB |
equal.c | -rw-r--r-- | 11.9 KB |
equalhash.c | -rw-r--r-- | 566 bytes |
equalhash.h | -rw-r--r-- | 165 bytes |
flisp.boot | -rw-r--r-- | 34.2 KB |
flisp.c | -rw-r--r-- | 82.9 KB |
flisp.h | -rw-r--r-- | 18.2 KB |
flmain.c | -rw-r--r-- | 1.9 KB |
iostream.c | -rw-r--r-- | 15.1 KB |
julia_charmap.h | -rw-r--r-- | 582 bytes |
julia_extensions.c | -rw-r--r-- | 15.1 KB |
julia_opsuffs.h | -rw-r--r-- | 3.1 KB |
mkboot0.lsp | -rw-r--r-- | 580 bytes |
mkboot1.lsp | -rw-r--r-- | 93 bytes |
opcodes.h | -rw-r--r-- | 5.3 KB |
print.c | -rw-r--r-- | 26.5 KB |
profile.scm | -rw-r--r-- | 2.8 KB |
read.c | -rw-r--r-- | 24.7 KB |
string.c | -rw-r--r-- | 9.4 KB |
system.lsp | -rw-r--r-- | 29.2 KB |
table.c | -rw-r--r-- | 6.5 KB |
types.c | -rw-r--r-- | 2.5 KB |
unittest.lsp | -rw-r--r-- | 8.1 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...