julia
05c6b2be - Extend code_typed to be able to debug constant prop

Commit
7 years ago
Extend code_typed to be able to debug constant prop 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.
Author
Committer
Parents
Loading