Closed Bug 597154 Opened 14 years ago Closed 11 years ago

Nanojit should not spill remat-able values

Categories

(Core Graveyard :: Nanojit, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: stejohns, Unassigned)

Details

Attachments

(1 obsolete file)

We're currently spilling values that don't need to be spilled (eg, constants).
Attached patch Naive patch (obsolete) — Splinter Review
Not sure if the fix is this simple?
Attachment #475969 - Flags: feedback?(wmaddox)
Target Milestone: --- → Future
As an example, every TR method emits at least two constants: 4 (undefinedAtom) and the AvmCore pointer. Both of these are remat-able but are spilled anyway.
Not sure. The semantics of the isInAr() flag mean that if the flag is set, some downstream code is loading from that stack slot, therefore a value must be written there. It's a bug if an instruction that has isInAr() = true doesn't store a value in that slot. It's also a bug (although benign) if the flag is set when no instruction ever loads from that slot. The second case happens in known situations. Any value that's defined before a loop, and live inside the loop, must have its live range extended across the whole loop. Because of spilling, the assembler has to reserve a stack slot for the instruction. However, a spill might not happen, and the reservation could be wasted. The assembler doesn't distinguish beween stack-slot-reserved, and stack-slot-required. Bill and I have talked about improving the AR logic to handle this. In the mean time, the extra spills are a FOL.
Also I think the canRemat() result is a red herring; strictly speaking, its not illegal for a rematerizeable value to be spilled. (I can safely say that, becuase illegal means "assert" and you aren't seeing an assert). It might be the case that all the uses surrounding canRemat() could be tightened up -- namely, that canRemat() *guarantees* a value won't be spilled, and therefore we should be able to assert that if canRemat() is true, isInAr() is false. but, audit is required.
Yeah, the above patch definitely isn't right. Definitely worth figuring out the right answer; emitting unnecessary stores is icky.
Attachment #475969 - Attachment is obsolete: true
Attachment #475969 - Flags: feedback?(wmaddox)
Product: Core → Core Graveyard
Nanojit has been dead for several years. Its Bugzilla component has been moved to the graveyard (bug 984276). I checked all the open bugs. They're all uninteresting, so I'm WONTFIXing them all. Apologies for the bugspam.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: