mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove an extra load that was generated for coro shadow copies.
emitShadowCopyIfNeeded has some extra code that was added when function arguments were moved out of the async context to ensure that they are being lifetime-extended, and there is also code that generates an incorrect load from the shadow copy. However, emitShadowCopyIfNeeded is supposed return either an alloca or the value, and IRGenDebugInfo knows to describe the value in the alloca already. The load is counterproductive it's only valid until whatever register it ends up in is clobbered, whereas the alloca is valid throughout the function. This patch removes the load and updates the tests accordingly. rdar://81805727
This commit is contained in:
@@ -952,9 +952,6 @@ public:
|
||||
if (ValueVariables.insert(shadow).second)
|
||||
ValueDomPoints.push_back({shadow, getActiveDominancePoint()});
|
||||
}
|
||||
auto inst = cast<llvm::Instruction>(shadow);
|
||||
llvm::IRBuilder<> builder(inst->getNextNode());
|
||||
shadow = builder.CreateLoad(shadow);
|
||||
}
|
||||
|
||||
return shadow;
|
||||
|
||||
Reference in New Issue
Block a user