If a receive case in a select statement is not assigned to a named variable, then we can eliminate the alloca and copy at runtime.
Details
Diff Detail
Event Timeline
irgen/channels.go | ||
---|---|---|
63–64 | Thanks, removed. | |
64–66 | It feels a little odd for frame to own methods; the frame is the subject here, so it feels more natural to have it as a top-level function operating on a frame. I'll change it back for now, for consistency's sake. | |
129 | The loop and index check should take care of multiple extract instructions. I don't think there would ever be multiple extract referrers with the same index, would there? |
LGTM. Comment is mostly nitpicking, this is fine as is.
irgen/channels.go | ||
---|---|---|
64–66 | Right, if we decide this is worth changing we should do it globally rather than be inconsistent. | |
129 | Yes, I meant multiple extract referrers with the same index. I agree that we probably won't ever see this, but it wouldn't hurt to check for them. |
Check all Extract referrers with a matching index, not just the first one.
irgen/channels.go | ||
---|---|---|
129 | Okay, done. |
It looks like we don't need this struct definition any more.