You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iterating the UnicodeScalarView generates some poor code, e.g. we spill the baseAddress pointer on each iteration, fail some LICM, and do not get a beneficial loop unswitch.
I do not believe in asking for general loop unswitching, which is often a pessimization. However, Swift's iterator design means that we are unable to manually unswitch iteration loops when we need to. So, we need some mechanism to communicate what path of an iteration loop should be unswitched, and branch-weight metadata doesn't do this for us in LLVM. This would dramatically decrease the register pressure on the fast path as well, so we wouldn't have to spill the pointer we're iterating over.
In the mean time, I'll try to hand-tune the code paths to compensate as much as possible.
Affected benchmark: StrComplexWalk
The text was updated successfully, but these errors were encountered:
, which is spilling the one register we don't want to spill here. This is all along the fast-path and LLVM branch-weight metadata is doing its job (red means fall-through), but it would also be far better to unswitch the loop, which should also alleviate register pressure.
Attachment: Download
Additional Detail from JIRA
md5: 3afd21a3d5c5fdb43a34542025636106
Parent-Task:
Issue Description:
Iterating the UnicodeScalarView generates some poor code, e.g. we spill the baseAddress pointer on each iteration, fail some LICM, and do not get a beneficial loop unswitch.
I do not believe in asking for general loop unswitching, which is often a pessimization. However, Swift's iterator design means that we are unable to manually unswitch iteration loops when we need to. So, we need some mechanism to communicate what path of an iteration loop should be unswitched, and branch-weight metadata doesn't do this for us in LLVM. This would dramatically decrease the register pressure on the fast path as well, so we wouldn't have to spill the pointer we're iterating over.
In the mean time, I'll try to hand-tune the code paths to compensate as much as possible.
Affected benchmark: StrComplexWalk
The text was updated successfully, but these errors were encountered: