Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1) Determine the number of loads/stores required for each variable assuming we are following a caller-saved convention (first column) or a callee-saved convention (second column).
1) Determine the number of loads/stores required for each variable assuming we are following a caller-saved convention (first column) or a callee-saved convention (second column). Specify the number of loads/stores executed both for each time the corresponding function (e.g. foo for variable a ) is executed, as well as each time the program is executed (i.e. \# per function call * number of calls). Assume the compiler checks for liveness across calls but does not make any other optimizations. ( 9 pts) Assume there are only 2 callee and 2 caller registers. Assign variables to a caller or callee register to minimize the number of loads/stores executed according to the strategy discussed in lecture. If designating a register as either caller or callee would not affect the number of loads/stores, we will accept either answer. ( 7 pts)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started