Ivopts: Improve doloop support for enum and bitint types
Extends doloop recognition to enum and bitint types by converting them to a full mode integer type.
This commit extends the loop induction variable (iv) optimization to handle enum and bitint types. Previously, the add_iv_candidate_for_doloop function only supported integer types. This commit modifies the function to accept non-integer types, converting them to a full mode integer type before processing. This change enables doloop optimization for loops using enum and bitint types as induction variables.
In Details
The ivopts pass optimizes loops by recognizing induction variables and transforming the loop into a doloop. This commit modifies add_iv_candidate_for_doloop to handle enum and bitint types, which are now returned by ninter. The code converts non-integer or non-full mode integer types to a full mode integer type. Search terms: GCC ivopts doloop induction variable.
For Context
Loop optimization is a crucial part of compiler optimization, where the compiler identifies patterns in loops to improve performance. One such pattern is the 'doloop', which has a simple and predictable structure. Induction variable optimization identifies variables that increment or decrement in each loop iteration. This commit enhances the compiler's ability to recognize doloops when the loop counter is an enum or bitint type, expanding the scope of this optimization. Search terms: GCC ivopts doloop induction variable.