Closed Bug 1507820 Opened 2 years ago Closed 1 year ago
Cranelift: pin Heap
Reg and maintain it
On x64, (ra)baldr excludes r15 from register allocation, and uses it as a pinned register for HeapReg. Cranelift isn't aware of this, and will use r15 for any purpose. There can be bad interactions during tiering because of this: say a main() function is in baseline code, which calls into cranelift code; baseline assumes the callee has preserved r15 and will try to reuse it. It would be an interesting optimization to have Cranelift use the heap register for heap loads/stores. But in the first place, Cranelift needs to preserve the r15 register.
Here's a temporary quick fix. I've tried just pushing/popping HeapReg in the right places, but it didn't work for some reason. With this and other changes from Cranelift 0.24, I could run the demo on webassembly.org \o/
Assignee: nobody → bbouvier
Attachment #9025688 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Summary: Cranelift doesn't preserve pinned registers → Cranelift: pin HeapReg and maintain it
Attachment #9091047 - Attachment description: Bug 1507820: Pin HeapReg in Cranelift and use it as the heap base; r?lth → Bug 1507820: Pin HeapReg in Cranelift and use it as the heap base; r=lth
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/cbe50166fcf0 Pin HeapReg in Cranelift and use it as the heap base; r=lth
You need to log in before you can comment on or make changes to this bug.