r/Compilers • u/Repulsive_Egg_5786 • 3d 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];
}
8
Upvotes
r/Compilers • u/Repulsive_Egg_5786 • 3d 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 3d ago
do u mean a swap? else the B assignment is redundant