Question: Consider the following procedure written in C: void scale _ by _ 7 ( int arr [ ] ) { int i; for ( i
Consider the following procedure written in C:
void scalebyint arr
int i;
fori ; i ; i
arri;
This code has been compiled with O to get the following x code:
xorl eax, eax
L:
movl rdi,raxecx
leal rcxedx #rd
subl ecx, edx #th
movl edx, rdi,rax
addq $rax
cmpq $rax
jne L
ret
What optimization has the compiler performed with the third and fourth assembly instructions?
code motion
strength reduction
common subexpression elimination
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
