[PATCH] D118128: [X86] selectLEAAddr - relax heuristic to only require one operand to be a MathWithFlags op (PR46809)
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 25 04:53:33 PST 2022
RKSimon created this revision.
RKSimon added reviewers: pengfei, spatel, craig.topper, lebedev.ri.
Herald added a subscriber: hiraditya.
RKSimon requested review of this revision.
Herald added a project: LLVM.
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 don't suggest that's really a problem. I'm open to suggestions on other tests we could try?
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D118128
Files:
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/combine-add.ll
llvm/test/CodeGen/X86/select-lea.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118128.402855.patch
Type: text/x-patch
Size: 7434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220125/c58f683b/attachment.bin>
More information about the llvm-commits
mailing list