[NFC][SILGen]: remove dead code in SILGenExpr#88429
Conversation
|
@swift-ci smoke test |
| return RValue(SGF, {value}, subType.getASTType()); | ||
| ManagedValue value = | ||
| SGF.B.createLoadTake(E, optTemp->getManagedAddress()); | ||
| return RValue(SGF, {value}, subType.getASTType()); |
There was a problem hiding this comment.
Want to confirm that deleting the condition here is the correct fix, and there's not something else we should be emitting in one of the branches. In the case below (~L7300-7312) the codegen looks more complex in the nontrivial branch.
| // The reason why we need to evaluate this especially is that otherwise we | ||
| // generate multiple conversion thunks. |
There was a problem hiding this comment.
I tried to figure out if this was still happening, but I couldn't find a case that reproduced this behavior. Maybe it was fixed in #86729?
| if (subExprType->hasExtInfo() && subExprType->getExtInfo().isSendable() && | ||
| subSubExprType->hasExtInfo() && | ||
| !subExprType->getExtInfo().isSendable() && | ||
| subExprType->withSendable(true) == subSubExprType) { |
There was a problem hiding this comment.
This is the reason why this code is effectively dead – the conjunction contains both subExprType->getExtInfo().isSendable() and !subExprType->getExtInfo().isSendable() (presumably this was a typo and the second one was supposed to be subSubExprType).
Does removal seem like the most appropriate change here, or would fixing the logic error be better?
slavapestov
left a comment
There was a problem hiding this comment.
I'm fine with deleting dead code that is not covered by tests.
Removes the following two bits of code in SILGenExpr that were either dead or superfluous:
RValueEmitter::visitConsumeExpr.