Revision 05c6b2be17af61573428d3fd6b36966a8e017e9d authored by Keno Fischer on 18 September 2018, 21:50:33 UTC, committed by Keno Fischer on 09 October 2018, 04:02:18 UTC
I'm currently debugging code that uses a lot of arrays with
dimensions in their type parameters. This type of code heavily
relies on constant propagation to lift dimensions from the value
domain into the type domain. Unfortunately, it's a bit hard to
discover what exactly causes inference to drop information from
constants, because there's no way to feed in constants for a
particular invocation using code_typed. This is a quick hack to
remidy that, by making `$`-interpolated expressions available
as constants to type inference, e.g.

```julia
julia> @code_typed 1+1
CodeInfo(
53 1 ─ %1 = (Base.add_int)(x, y)::Int64
   └──      return %1
) => Int64

julia> @code_typed $(1)+$(1)
CodeInfo(
53 1 ─     return 2
) => Int64
```

Additionally, this extends the same mechanism to apply to
get/setproperty!, even in the absence of `$` for the symbol
argument, reflecting their special casing inference.
1 parent cfc967b
History
File Mode Size
.circleci
.github
base
contrib
deps
doc
etc
src
stdlib
test
ui
.freebsdci.sh -rwxr-xr-x 1.2 KB
.gitattributes -rw-r--r-- 67 bytes
.gitignore -rw-r--r-- 235 bytes
.mailmap -rw-r--r-- 9.5 KB
.travis.yml -rw-r--r-- 6.9 KB
CONTRIBUTING.md -rw-r--r-- 20.5 KB
DISTRIBUTING.md -rw-r--r-- 23.6 KB
HISTORY.md -rw-r--r-- 238.0 KB
LICENSE.md -rw-r--r-- 5.1 KB
Make.inc -rw-r--r-- 36.3 KB
Makefile -rw-r--r-- 28.3 KB
NEWS.md -rw-r--r-- 858 bytes
README.arm.md -rw-r--r-- 5.7 KB
README.md -rw-r--r-- 29.2 KB
README.windows.md -rw-r--r-- 13.0 KB
VERSION -rw-r--r-- 10 bytes
Windows.inc -rw-r--r-- 1.5 KB
appveyor.yml -rw-r--r-- 2.6 KB

README.md

back to top