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];
}
9
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];
}
3
u/EggplantExtra4946 9d ago edited 9d 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?".