Deopt operands are generally intended to record information about a site in code with minimal perturbation of the surrounding code. Idiomatically, they also tend to appear down rare paths. Putting these together, we have an obvious case for extending CVP w/deopt operand constant folding. Arguably, we should be doing this for all operands on all instructions, but that's definitely a much larger and risky change.
A few items to note for the review:
- The const_cast is definitely ugly, but the API for operand bundles seemed to require it. Is there a better way to structure this?
- As noted w/a TODO, I initially tried to use a context instruction here, but discovered that the result returned by LVI was actually wrong. It seemed return something true *after* the context instruction, not before it. For an instruction like a guard or assume, that difference is quite material!