Consider the optimization of inlining: replacing a function…

Consider the optimization of inlining: replacing a function call by expanding the called function’s body into the caller. Here is a simple example in Tiger IR to illustrate its behavior. Without inlining start_function square int square(int x) int-list: x float-list:square: ret = x * x; return ret;end_function square// somewhere else in the program: b = a * 2; r = call square(b); if a < r goto label1; With inlining, the code at the end becomes b = a * 2; r = b * b; // this line changed if a < r goto label1; Assuming no other optimizations occur, what is the performance benefit of inlining a function call? If other optimizations occur, can inlining provide further benefits? If so, describe how. Describe a way in which inlining may worsen performance. Based on parts (1) – (3), give a heuristic that an optimizer could use to decide if an individual function call should be inlined – i.e., the benefit of inlining it is likely to exceed the drawback. Are there cases where a function call cannot be inlined because doing so would cause incorrect or erroneous behavior? Briefly explain why or why not. (15 pts)

Minimize the following DFA using Brzozowski’s algorithm.  S…

Minimize the following DFA using Brzozowski’s algorithm.  Show the resulting DFA after the first (backward) pass. Show the final resulting DFA after the second (forward) pass.  You may choose the names for states in each DFA. Write each DFA in the following format, illustrated with the original DFA:  States: 0, 1, 2, 3 Start state 0  Accepting states: 1, 3 Transitions: (0, a) = 1, (0, b) = 2, (1, a) = 1, (2, a) = 3, (3, a) = 3 (12 pts)