Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.arch Subject: Re: Instruction Scheduling Message-ID: Date: 11 Apr 91 15:41:14 GMT References: <32097@shamash.cdc.com> <1991Apr8.224717.14402@aero.org> <1991Apr10.131341.26357@b11.ingr.com> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 51 In-reply-to: dclark@b11.ingr.com's message of 10 Apr 91 13:13:41 GMT In article <1991Apr10.131341.26357@b11.ingr.com> dclark@b11.ingr.com (Dave Clark) writes: | jordan@aero.org (Larry M. Jordan) writes: | | >Where and when does instruction scheduling/reorganizing occur? Is | >this function performed by the HOL compilers? (If so, the symbolic | >assembly I'm reading obscures this fact. If not, then during | >assembly?) | | Yes and no. Most HOL compilers do some sort of optimizing on the | back-end. Although I haven't (yet) seen an assembler that does | optimizations, I have seen utilities that can optimize assembly | code (part of an HOL compiler back-end). The MIPS assemblers do instruction scheduling. It sometimes is annoying to have to disassemble the object file to find exactly what sequences of instructions are used. | Assembly level: This is a good place to put machine-specific optimi- | zations. Instruction timing and reordering is a simple search prob- | lem, especially on the advanced RISC chips. However at the assembly level can be too late if the latency is high enough. For example, if the compiler reuses register temps quick enough, the assembler doesn't have a chance to do aggresive code movement, since the next instruction reuses the register that you are waiting to be reloaded. For example, if the code sequence is: a = b; c = d; a compiler on a load/store machine might rewrite this as: reg = b; a = reg; reg = d; c = reg; wheras if you have a latency, and you have plenty of registers, you really want to rewrite it as: reg1 = b; reg2 = d; a = reg1; c = reg2; -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Considering the flames and intolerance, shouldn't USENET be spelled ABUSENET?