


















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















Constant Folding
Unreachable Code
Flow of control optimizations
Algebraic Simplification
Dead code
Reduction in strength
x = a[t 6 ]
x = a[t 6 ]
i = m - 1 j = n t 1 =4 * n v = a[t 1 ]
i = i + 1 t 2 = 4 * i t 3 = a[t 2 ] if t 3 < v goto B 2
j = j โ 1 t 4 = 4 * j t 5 = a[t 4 ] if t 5 > v goto B 3
if i >= j goto B 6
t 6 = 4 * i
t 7 = 4 * i t 8 = 4 * j t 9 = a[t 8 ] a[t 7 ] = t 9 t 10 = 4 * j a[t 10 ] = x goto B 2
t 11 = 4 * i x = a[t 11 ] t 12 = 4 * i t 13 = 4 * n t 14 = a[t 13 ] a[t 12 ] = t 14 t 15 = 4 * n a[t 15 ] = x
i = m - 1 j = n t 1 =4 * n v = a[t 1 ]
i = i + 1 t 2 = 4 * i t 3 = a[t 2 ] if t 3 < v goto B 2
j = j โ 1 t 4 = 4 * j t 5 = a[t 4 ] if t 5 > v goto B 3
if i >= j goto B 6
t 6 = 4 * i
t 8 = 4 * j t 9 = a[t 8 ] a[ t 6 ] = t 9 t 10 = 4 * j a[t 10 ] = x goto B 2
t 11 = 4 * i x = a[t 11 ] t 12 = 4 * i t 13 = 4 * n t 14 = a[t 13 ] a[t 12 ] = t 14 t 15 = 4 * n a[t 15 ] = x
i = m - 1 j = n t 1 =4 * n v = a[t 1 ]
i = i + 1 t 2 = 4 * i t 3 = a[t 2 ] if t 3 < v goto B 2
j = j โ 1 t 4 = 4 * j t 5 = a[t 4 ] if t 5 > v goto B 3
if i >= j goto B 6
t 6 = 4 * i
t 8 = 4 * j t 9 = a[t 8 ] a[ t 6 ] = t 9 a[ t 8 ] = x goto B 2
t 11 = 4 * i x = a[t 11 ] t 12 = 4 * i t 13 = 4 * n t 14 = a[t 13 ] a[t 12 ] = t 14 t 15 = 4 * n a[t 15 ] = x
i = m - 1 j = n t 1 =4 * n v = a[t 1 ]
i = i + 1 t 2 = 4 * i t 3 = a[t 2 ] if t 3 < v goto B 2
j = j โ 1 t 4 = 4 * j t 5 = a[t 4 ] if t 5 > v goto B 3
if i >= j goto B 6
t 6 = 4 * i
t 8 = 4 * j t 9 = a[t 8 ] a[ t 6 ] = t 9 a[ t 8 ] = x goto B 2
t 11 = 4 * i x = a[t 11 ] t 13 = 4 * n t 14 = a[t 13 ] a[ t 11 ] = t 14 t 15 = 4 * n a[t 15 ] = x
i = m - 1 j = n t 1 =4 * n v = a[t 1 ]
i = i + 1 t 2 = 4 * i t 3 = a[t 2 ] if t 3 < v goto B 2
j = j โ 1 t 4 = 4 * j t 5 = a[t 4 ] if t 5 > v goto B 3
if i >= j goto B 6
t 6 = 4 * i
t 8 = 4 * j t 9 = a[t 8 ] a[ t 6 ] = t 9 a[ t 8 ] = x goto B 2
t 11 = 4 * i x = a[t 11 ] t 13 = 4 * n t 14 = a[t 13 ] a[ t 11 ] = t 14 a[ t 13 ] = x
i = m - 1 j = n t 1 =4 * n v = a[t 1 ]
i = i + 1 t 2 = 4 * i t 3 = a[t 2 ] if t 3 < v goto B 2
j = j โ 1 t 4 = 4 * j t 5 = a[t 4 ] if t 5 > v goto B 3
if i >= j goto B 6
t 8 = 4 * j t 9 = a[t 8 ] a[ t 2 ] = t 9 a[ t 8 ] = x goto B 2
t 11 = 4 * i x = a[t 11 ] t 13 = 4 * n t 14 = a[t 13 ] a[ t 11 ] = t 14 a[ t 13 ] = x
i = m - 1 j = n t 1 =4 * n v = a[t 1 ]
i = i + 1 t 2 = 4 * i t 3 = a[t 2 ] if t 3 < v goto B 2
j = j โ 1 t 4 = 4 * j t 5 = a[t 4 ] if t 5 > v goto B 3
if i >= j goto B 6
x = t 3 t 9 = a[ t 4 ] a[ t 2 ] = t 9 a[ t 4 ] = x goto B 2
t 11 = 4 * i x = a[t 11 ] t 13 = 4 * n t 14 = a[t 13 ] a[ t 11 ] = t 14 a[ t 13 ] = x
i = m - 1 j = n t 1 =4 * n v = a[t 1 ]
i = i + 1 t 2 = 4 * i t 3 = a[t 2 ] if t 3 < v goto B 2
j = j โ 1 t 4 = 4 * j t 5 = a[t 4 ] if t 5 > v goto B 3
if i >= j goto B 6
x = t 3 a[ t 2 ] = t 5 a[ t 4 ] = x goto B 2
t 11 = 4 * i x = a[t 11 ] t 13 = 4 * n t 14 = a[t 13 ] a[ t 11 ] = t 14 a[ t 13 ] = x