Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!