-
Notifications
You must be signed in to change notification settings - Fork 10.5k
OSSA: simplify-cfg support for trivial block arguments. #36118
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
I was badly confused for a while.
The API for values is on the ValueBase. SILValue is supposed to be a pointer-like wrapper class. Accessing a value's API is always done as 'value->api()'. The ValueBase subclasses, like SingleValueInstruction, need to inherit the API. I didn't have time to fix all the cases of value.isOwnershipKind() throughout the code.
This should be used instead of isLifetimeEnding wherever the code assumes an owned value is consumed. isLifetimeEnding should only be used when the code is expected to handle both owned and guaranteed values.
To allow a value's use-list to be pased into an LLVM API that expects an llvm::iterator_range<SILInstruction *>.
@swift-ci test |
@swift-ci test source compatibility |
@swift-ci benchmark |
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.
Did a quick look through, found a few issues.
Build failed |
Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -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
|
I had a difficult time determining to set of possible operand ownership kinds for callee operands.
This was running the SIL verifier in the asserts build unconditionally on every function even if this pass did nothing.
Enable most simplify-cfg optimizations as long as the block arguments have trivial types. Enable most simplify CFG unit tests cases. This massively reduces the size of the CFG during OSSA passes. Test cases that aren't supported in OSSA yet have been moved to a separate test file for disabled OSSA tests, Full simplify-cfg support is currently blocked on OSSA utilities which I haven't checked in yet.
@swift-ci test |
@swift-ci test source compatibility |
Build failed |
695a5d1
to
ba9f520
Compare
@swift-ci smoke test |
This only enables existing optimizations, so the regressions are pass ordering and inlining related. Nonetheless, we should try to recover these as part of OSSA performance work: rdar://74680854 (OSSA: Investigate performance regressions after enabling trivial simplify-cfg) |
Several small NFC commits lead up to this one important commit:
Enable most simplify-cfg optimizations as long as the block arguments
have trivial types. Enable most simplify CFG unit tests cases.
This massively reduces the size of the CFG during OSSA passes.
Test cases that aren't supported in OSSA yet have been moved to a
separate test file for disabled OSSA tests,
Full simplify-cfg support is currently blocked on OSSA utilities which
I haven't checked in yet.