Compiler Assignment
Compiler Assignment
You are working as a software developer for a company that produces real-time embedded systems for
autonomous vehicles. The company is facing a critical challenge: the current compiler's generated code
for pathfinding algorithms is too slow, resulting in delays during real-time navigation. You are tasked
with improving the system's performance by applying global optimization techniques in the compiler.
The code provided for the pathfinding algorithm contains multiple redundant calculations, dead code,
and inefficient register usage. Your team suggests using global optimizations such as loop-invariant code
motion, constant propagation, and register allocation to optimize the compiled code.
Task:
1. Synthesis (Create):
o Design a step-by-step plan to optimize the pathfinding algorithm using at least two
global optimization techniques. Justify your choice of techniques based on the
characteristics of the algorithm.
o Implement pseudo-code or annotate the provided code sample to demonstrate how the
chosen optimizations would be applied.
2. Evaluation (Judge):
o Exemplary (5 points): The student accurately identifies and explains two or more global
optimization techniques. The explanation demonstrates a deep understanding of the
techniques and their relevance to the provided scenario.
o Proficient (4 points): The student correctly identifies two techniques and provides a
clear explanation of their use, though there may be minor gaps in understanding.
o Developing (3 points): The student identifies one or two techniques, but the reasoning
is unclear or partially incorrect.
3. Evaluation of Trade-offs:
o Proficient (4 points): The student evaluates the trade-offs with some depth, addressing
most key points but may miss one constraint or lack detail in one area.
o Beginning (2 points): The student provides minimal evaluation, with little relevance to
the scenario or significant gaps in addressing major trade-offs.
4. Recommendations:
o Proficient (4 points): The response is well-organized and mostly clear, with minor issues
in clarity or logical progression.
o Developing (3 points): The response lacks clarity or organization, with several unclear
explanations or poorly explained concepts.
o Beginning (2 points): The response is disorganized, with unclear explanations and little
logical flow.