{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

07-code - Instruction selection Simple approach...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Instruction selection Simple approach : Macro-expand each IR tuple/subtree into machine instructions Expanding tuples/subtrees independently poor quality code Sometimes mapping is many-to-one “Maximal munch”: works reasonably well with RISC Other approaches : Model target machine state as IR is expanded ( interpretive code generation ) Copyright c 2007 by Antony L. Hosking. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and full citation on the first page. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or fee. Request permission to publish from [email protected] CS502 Instruction selection 1 Register and temporary management Temporaries hold data values relevant to current computation: Usually registers May be in-memory storage temporaries in local stack frame Register allocation : assign registers to temporaries Limited number of hard registers some temporaries may need to be allocated to storage assume a pseudo-register for each temporary register allocator chooses temporaries to spill allocator generates corresponding mapping allocator inserts code to spill/restore pseudo-registers to/from storage as necessary We will deal with register allocation after instruction selection CS502 Instruction selection 2 Tree patterns
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern