[PATCH] D61472: [X86FixupLEAs] Turn optIncDec into a generic two address LEA optimizer. Support LEA64_32r properly.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 13:46:23 PDT 2019


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

In D61472#1516642 <https://reviews.llvm.org/D61472#1516642>, @craig.topper wrote:

> In D61472#1515994 <https://reviews.llvm.org/D61472#1515994>, @spatel wrote:
>
> > I haven't looked closely at the series of transforms that gets us here, so let me ask: would it be more efficient to produce the add/inc/dec machine instructions directly rather than LEA? Or do we do this because the 3-address opportunity helps register allocation, so this late reversal is a special-case of the more generally useful transforms that produce LEA in the 1st place?
>
>
> I believe a lot of these are caused TwoAddressInstructionPass converting to three address sometimes when it maybe shouldn't. I think there's some overlap with the test diffs in D52109 <https://reviews.llvm.org/D52109>. But I don't think the change I made in that diff is correct. There appear to be some test changes here that aren't affected by that patch either. So maybe there are other issues in TwoAddressInstruction heuristics.


Ok - these diffs look alright, so LGTM. Maybe we can adjust the earlier transforms to avoid some back-and-forth though as follow-up work.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61472/new/

https://reviews.llvm.org/D61472





More information about the llvm-commits mailing list