compile: convert standalone LEA to ADD/SUB to reduce port contention on x86/amd64 #49087
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Except very new cores (e.g. sunny cove) LEA usually has around 2 cpu ports to execute while ADD has equal or more (4). It has shown advantageous in production profiles of C++ compiler optimized binaries to use ADD/SUB instead of LEA to reduce port contention.
We should test adding a pass after current SSA optimization that transforms stand alone simple LEA instructions (wasnt fused with compares ore moves) to use ADD and SUB where equivalent (modulo flags). We could also use that pass to split slow 3 operand LEAs to multiple ADDs or 2 operand LEAs.
The text was updated successfully, but these errors were encountered: