|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
recognition and optimization of prefix computation or variants in C/C++ compilers
Hi,
Does the current C/C++ compilers in industry recognize idioms of the form of prefix computation and transform them? For instance, given for (i = 0; i < n; i++) for (j = 0; j < i; j++) result[i] = result[i] + a[j]; transform this to result [0] = a[0]; for (i = 1; i < n; i++) result[i] = result[i-1] + a[i]; If so, under what class of optimizations do they do this? In the general case, a similar prefix pattern can be identified and seen in certain search/traversal algorithms also. Do the existing compilers handle any of those as well? |
![]() |
| Viewing: Web Development Archives > FAQs > Compilers > recognition and optimization of prefix computation or variants in C/C++ compilers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|