Question: Given the following code, apply basic and loop optimization technique to simplify the code. while ( i 1 0 0 ) { a = Sin
Given the following code, apply basic and loop optimization technique to simplify the
code.
while
Sin
i;
Instructions:
Construct a threeaddress code and then detect loops.
Follow the slides on how to detect loops show all steps, finding leaders, creating
basic blocks and constructing program flow graph
Once the loop is identified, optimize it using loop unrolling and frequency reduction
techniques also basic optimization techniques if needed.
Provide the optimized version of the loop after each optimization step.
Explain the rationale behind each optimization technique and how it improves the
efficiency of the loop.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
