X86: Minor regression from llvm 14 with single array access and lea #56742
Labels
backend:X86
question
A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
When arrays are accessed once in a function, llvm14 produces a
mov
instruction that references the array in memory. However, trunk produces a lea that moves the array into a register, then performs themov
. This change makes sense when the array is accessed multiple times as it removes the extraneous memory reference, but it adds an additional unneeded instruction when there is only a single access of the array.Code
Compiling with:
-O3
Godbolt: https://godbolt.org/z/W4saM9fha
trunk codegen
llvm 14 codegen
The text was updated successfully, but these errors were encountered: