RESOLVED FIXED 270971
Unpredictable temporary selection in offlineasm
https://bugs.webkit.org/show_bug.cgi?id=270971
Summary Unpredictable temporary selection in offlineasm
Max Rottenkolber
Reported 2024-03-14 05:26:29 PDT
assignRegistersToTemporaries reverses its freeRegisters stack in each iteration, leading to somewhat unpredictable assignment of scratch registers. This goes against the inline documentation for scratch register allocation: # These are allocated from the end. Use the low order r6 first, ast it's often # cheaper to encode. r12 and r9 are equivalent, but r9 conflicts with t7, so r9 # only as last resort. So for example the following unstable expansions occur (on armv7): leap (x), t7 -> globaladdr x, r9, r12 leap (x), t7 -> globaladdr x, r9, r9 leap (x), t7 -> globaladdr x, r9, r12 We should maintain the freeRegisters stack order across iterations to ensure temp/scratch priority is respected.
Attachments
Mark Lam
Comment 1 2024-03-14 13:32:58 PDT
FWIW, the "inline documentation" that Max quoted is specific to 32-bit arm i.e. armv7 only.
Radar WebKit Bug Importer
Comment 2 2024-03-21 05:27:13 PDT
EWS
Comment 3 2024-05-16 01:53:32 PDT
Committed 278856@main (4a07711b9554): <https://commits.webkit.org/278856@main> Reviewed commits have been landed. Closing PR #25882 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.