Optimizations not applied when separate variables are used #45126
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
I noticed a case from this thread where the optimizations applied by the compiler are determined by the presence or absence of intermediate variables
Looking at the assembly in the first case, it's clearly generating the two arrays separately.
In the second case, it does not appear to generate the arrays.
This is a little bit surprising to me and seems a bit undesirable since this means that making code more readable by storing intermediate operations in variables could lead to optimizations not being applied.
The text was updated successfully, but these errors were encountered: