Discussion
Register allocation is performed
Answer: B
Correct answer: in the code generation phase of the back end
Registers are a property of the target machine - how many there are, which are reserved, which instructions can use which. Nothing about them exists in the machine-independent intermediate code.
Allocation therefore belongs to the back end, alongside instruction selection and scheduling. Doing it earlier would tie the intermediate form to one architecture and destroy the point of a common representation. The front end deals in an unlimited supply of temporaries; the back end maps them onto real registers and spills the remainder.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development