ps5-sol - ECE 573 Problem Set 5: Register allocation For...

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

View Full Document Right Arrow Icon
ECE 573 Problem Set 5: Register allocation For the following problems, use the following piece of three-address code (the target of each instruction is the last temporary listed): 1. ld a, T1 2. ld b, T2 3. + T1, T2, T3 4. ld c, T4 5. + T1, T2, T5 6. + T4, T5, T6 7. + T3, T6, T7 8. + T7, a When performing register allocation for this code, assume that only temporaries are assigned to registers. 1. We perform liveness analysis from the bottom up (so read the table from the bottom up, including comments): Inst Live temps Comments 1 T1 T2 killed in instruction 2, so not live. 2 T1, T2 T3 killed in instruction 3, so not live. 3 T1, T2, T3 T4 killed in instruction 4, so not live. 4 T1, T2, T3, T4 T5 killed in instruction 5, so not live, T1, T2 used in instruction 5, so live. 5 T3, T4, T5 T6 killed in instruction 6, so not live. T4, T5 used in instruction 6, so live. 6 T3, T6 T7 killed in instruction 7, so not live. T3, T6 used in instruction 7, so live. 7
Background image of page 1

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

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

Page1 / 4

ps5-sol - ECE 573 Problem Set 5: Register allocation For...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online