[all-commits] [llvm/llvm-project] 0b00cd: [X86] selectLEAAddr - relax heuristic to only requ...
Simon Pilgrim via All-commits
all-commits at lists.llvm.org
Tue Feb 8 07:09:43 PST 2022
Author: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: 2022-02-08 (Tue, 08 Feb 2022)
[X86] selectLEAAddr - relax heuristic to only require one operand to be a MathWithFlags op (PR46809)
As suggested by @craig.topper, relaxing LEA matching to only require the ADD to be fed from a single op with EFLAGS helps avoid duplication when the EFLAGS are consumed in a later, dependent instruction.
There was some concern about whether the heuristic is too simple, not taking into account lost loads that can't fold by using a LEA, but some basic tests (included in select-lea.ll) don't suggest that's really a problem.
Differential Revision: https://reviews.llvm.org/D118128
More information about the All-commits