
This review has been a long time coming. #SwiftLang
SE-0491: Module selectors for name disambiguation https://forums.swift.org/t/se-0491-module-selectors-for-name-disambiguation/82124
#Tag
This review has been a long time coming. #SwiftLang
SE-0491: Module selectors for name disambiguation https://forums.swift.org/t/se-0491-module-selectors-for-name-disambiguation/82124
This review has been a long time coming. #SwiftLang
SE-0491: Module selectors for name disambiguation https://forums.swift.org/t/se-0491-module-selectors-for-name-disambiguation/82124
Periodic reminder that the rule Swift Concurrency imposes is "you cannot block a thread to wait for future async work", not "you cannot block a thread". The actual rule is much easier to comply with than the shorter version that gets mistakenly passed around.
Blocking a thread may or may not be the right design for your particular code, but it only violates language requirements if you wait for async work.
One is "might slow down other work", the other is "might never finish".
Periodic reminder that the rule Swift Concurrency imposes is "you cannot block a thread to wait for future async work", not "you cannot block a thread". The actual rule is much easier to comply with than the shorter version that gets mistakenly passed around.
Blocking a thread may or may not be the right design for your particular code, but it only violates language requirements if you wait for async work.
One is "might slow down other work", the other is "might never finish".
My team at Apple is currently hiring for a role that focuses on compiler tools and infrastructure. If you’re interested in this opportunity, please take a look at the job posting here: https://jobs.apple.com/en-us/details/200613714/compiler-tools-engineer?team=SFTWR #llvm #swiftlang
My team at Apple is currently hiring for a role that focuses on compiler tools and infrastructure. If you’re interested in this opportunity, please take a look at the job posting here: https://jobs.apple.com/en-us/details/200613714/compiler-tools-engineer?team=SFTWR #llvm #swiftlang
Y'all wanna see an excessively cute trick LLVM's optimizer can do?
Swift String contains roughly this method:
```
func _fastCStringContents() -> UnsafePointer<UInt8> {
if isASCII {
return contentsPointer
}
return nil
}
```
Where `isASCII` is defined as `(flags & 0x8000_0000_0000_0000) != 0`
Would you expect this to generate (solution in reply)
It generates 0 branches and 0 conditional moves, here's how:
Step 1: Note how the isASCII test checks the sign bit of flags
Step 2: Right-shift flags by 63, replacing every bit with the sign bit
Step 3: You now have a constant with 64 1s or 64 0s. Note x & allOnes == x
, and x & allZeroes == 0
Final result:
<br/>func _fastCStringContents() -> … {<br/> return contentsPointer & (flags >> 63)<br/>}<br/>
See https://github.com/llvm/llvm-project/commit/d545c9056e00988d2d146f8f1440b2dd192f306b
Early bird ticket sales are now available for #DevWorld and #XWorld! Get it while it's cheap!
Join us in #Melbourne! First round CFP also closes 8PM AEST TODAY!
A space for Bonfire maintainers and contributors to communicate