Excerpts from Simon Marlow's message of Mon May 16 04:12:29 -0400 2011: > This is as it should be. The reason there are no CALLER_SAVES_Hp or > similar is because we deliberately avoid using caller-saves registers > for Hp due to the cost. It would work fine (due to the code here), but > it would be expensive.
OK, good to know I'm not too far off the mark. I'll adjust this comment. > So the right solution here is to annotate non-local jumps with the > global registers that are live (see the ToDo comment on CmmCall in > CmmNode.hs). Then, we can arrange that CmmUnsafeForeignCall has the > intended semantics (it preserves all registers), because the native code > generator will be able to save and restore caller-saves registers itself. Aha! > The interrim solution, that we have now, is to arrange that caller-save > global registers are never live across an unsafe foreign call. That's > the change you just made. It would be good to have a comment somewhere > to the effect that this is just a temporary solution. Can do. > We really don't want to be inferring the "vols" in the way the old code > generator did it, that was much worse. The new way will be better, once > we have non-local jumps annotated with the liveness of global registers, > because then we will have full liveness information. Also, we'll be > able to re-use the R registers in the body of a function, because the > register allocator will have enough liveness information to do so - this > could be quite a big win. Ooh, exciting. :-) Edward _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
