julia
80464f85 - irinterp: Be sure to inline const values (#46629)

Commit
3 years ago
irinterp: Be sure to inline const values (#46629) Ordinarily, annotating a `Const` type on a statement is sufficent to ensure that it eventually gets moved into statement position. The actual transformation is usually done by the inlining pass. However, since no inlining pass runs on the result of semi-concrete evaulation, we need to do here what it would have otherwise done if it did run. The other change here is to move const GlobalRefs back into argument position, which is required to make the test work. The issue here is that we round-trip the IR through the global cache, which widens all constants, so the type field no longer reflects that `sitofp` is `Const(sitofp)` but rather widens it to `IntrinsicFunction`. This is a bit unfortunate in general, as it means that irinterp doesn't have access to constant information that was discovered during regular inference. In the future we may want to consider trying to perseve that constant information longer. However, for the time being, I think moving const bindings (by far the most common source of Const information in the IR that doesn't get immediately transformed into const values) back into argument position provides a tempoary solution.
Author
Parents
Loading