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

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 24 13:13:43 PDT 2019


craig.topper added a comment.

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.


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

https://reviews.llvm.org/D61472





More information about the cfe-commits mailing list