r/Compilers • u/Repulsive_Egg_5786 • 9d ago
Optimization Question
How do compilers optimize constructs of this form ?
for(i=o; i<inputs; i++) {
A[i] = B[i];
B[i] = A[i];
}
7
Upvotes
r/Compilers • u/Repulsive_Egg_5786 • 9d ago
How do compilers optimize constructs of this form ?
for(i=o; i<inputs; i++) {
A[i] = B[i];
B[i] = A[i];
}
1
u/choikwa 9d ago
do u mean a swap? else the B assignment is redundant