@oli-obk recently cleaned up our nullary intrinsics so that the backends now only ever see them as constants. This is nice because
- we don't need a codepath for each backend
- even MIR optimizations can now see and reason about the values of these operators without special support
However, we still have some "nullary operators" in MIR that
- are implemented in each backend
- and in fact also have an implementation duplicated across multiple MIR opts (dataflow_const_prop, gvn, known_panics_lint)
It would be nice to also clean those up. It is fairly easy to move the direct invocations of the corresponding intrinsics into const blocks, but IIRC some of these nullary ops are also use by some MIR shims and that would then be more difficult to handle. (But I am not sure about this, I may entirely misremember why we added NullaryOp in the first place.)
Cc @scottmcm @rust-lang/wg-mir-opt
@oli-obk recently cleaned up our nullary intrinsics so that the backends now only ever see them as constants. This is nice because
However, we still have some "nullary operators" in MIR that
It would be nice to also clean those up. It is fairly easy to move the direct invocations of the corresponding intrinsics into const blocks, but IIRC some of these nullary ops are also use by some MIR shims and that would then be more difficult to handle. (But I am not sure about this, I may entirely misremember why we added
NullaryOpin the first place.)Cc @scottmcm @rust-lang/wg-mir-opt