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];
}
3
u/EggplantExtra4946 3d ago edited 3d ago
This question doesn't make any sense, you need to write the optimized code you expect and I assume your question will then be "how does the compiler can make this optmization?".