x86_cse: Convert CONST_VECTOR load to constant integer load
The x86 compiler can now convert constant vector loads into constant integer loads, improving code generation for certain operations.
The x86 common subexpression elimination (CSE) pass can now convert CONST_VECTOR loads that are no larger than an integer register into constant integer loads. This optimization applies when loading a constant vector into an MMX or XMM register. Redundant constant integer loads are now kept, and the code generates zero CONST_VECTOR loads. This change can improve code generation for vector operations on x86 architectures.
In Details
This commit modifies the x86_cse::x86_cse pass in config/i386/i386-features.cc to convert CONST_VECTOR loads to constant integer loads when the vector size is within the integer register size. The ix86_place_single_vector_set function is updated to accommodate this change. This transformation allows the compiler to handle certain vector constants more efficiently during CSE.
For Context
Common Subexpression Elimination (CSE) is a compiler optimization that identifies and eliminates redundant calculations. This commit improves CSE for x86 architectures by allowing the compiler to replace constant vector loads with constant integer loads in specific cases. This can lead to more efficient code generation, particularly when dealing with small constant vectors used in vector operations.