-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Optimizer: remove the CopyForwarding pass #85005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@swift-ci smoke test |
|
@swift-ci apple silicon benchmark |
|
I'm loving all these PRs that are removing redundant/unused/marginal optimizer passes from the pipeline. Great job! |
lib/SIL/Utils/InstructionUtils.cpp
Outdated
| case SILInstructionKind::CopyAddrInst: { | ||
| auto *ca = cast<CopyAddrInst>(inst); | ||
| if (ca->getSrc()->getType().isTrivial(ca->getFunction())) | ||
| if (!ca->getSrc()->getType().hasArchetype()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this case still need refcounting effect ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thanks!
I fixed it
It only needs metadata if the copied type has an archetype
This pass removes `copy_addr` instructions. However, it has some problems which causes compiler crashes. It's not worth fixing these bugs because 1. Most copy_addrs can be eliminated by TempRValueElimination and TempLValueElimination. 2. Once we have opaque value we don't need copy_addr elimination, anyway. rdar://162212460
f5f159a to
7a70049
Compare
|
@swift-ci smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This pass removes
copy_addrinstructions.However, it has some problems which causes compiler crashes.
It's not worth fixing these bugs because
This PR also contains some improvements for TempRValueElimination to compensate for the missing CopyForwarding pass.
rdar://162212460