Because of concerns with the underlying code of TransformCompoundAssignmentLHS (#36443), we're not currently using BoundSpillSequences to lower ??= in the nullable value type case. We can improve codegen by using these after we're sure that the causes of #36443 are fixed.
Current codegen form:
var tmp = lhsRead.GetValueOrDefault()
lhsRead.HasValue ? tmp : { /* sequence */ tmp = loweredRight; transformedLhs = tmp; tmp }
Better form:
var tmp = lhsRead.GetValueOrDefault();
if (lhsRead.GetValueOrDefault())
{
tmp = loweredRight;
transformedLhs = tmp;
}
tmp
This better form needs a BoundSpillSequence.
Because of concerns with the underlying code of
TransformCompoundAssignmentLHS(#36443), we're not currently usingBoundSpillSequences to lower ??= in the nullable value type case. We can improve codegen by using these after we're sure that the causes of #36443 are fixed.Current codegen form:
Better form:
This better form needs a
BoundSpillSequence.