-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SimplifyCFG: fix an infinite jump-threading loop. #35614
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 test |
@swift-ci benchmark |
The JumpThreadingCost map in Simplify CFG is used to prevent infinite jump threading loops. There was a missing update of the cost for blocks which are cloned: Jump threading loops were prevented for infinitely cloning the original block, but not for re-cloning the cloned block. A test case is already added in 8948f75 rdar://73357726, [SR-14068]
2aebf4e
to
fe928d5
Compare
@swift-ci benchmark |
@swift-ci test |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Build failed |
@swift-ci test macOS |
1 similar comment
@swift-ci test macOS |
It looks like you want to use I do think it's a good idea to generally limit run-away jump-threading. But I'm still worried about small loops, so still like this safeguard: #35608 The thing that is particularly baffling to me is that this cost is initialized in |
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.
This looks good to me. I'll merge this PR and add the necessary comments in a follow-up PR.
The JumpThreadingCost map in Simplify CFG is used to prevent infinite jump threading loops.
There was a missing update of the cost for blocks which are cloned:
Jump threading loops were prevented for infinitely cloning the original block, but not for re-cloning the cloned block.
A test case is already added in #35604
rdar://73357726, [SR-14068]