This is an archive of the discontinued LLVM Phabricator instance.

[X86] Memory folding for commutative instructions (updated)
ClosedPublic

Authored by RKSimon on Oct 16 2014, 3:41 AM.

Details

Summary

This patch improves support for commutative instructions in the x86 memory folding implementation by attempting to fold a commuted version of the instruction if the original folding fails - if that folding fails as well the instruction is 're-commuted' back to its original order before returning.

Updated version of http://reviews.llvm.org/D5701 (reverted in r219595) - the commutation attempt now explicitly ensures that neither of the commuted source operands are tied to the destination operand / register, which was the source of all the regressions that occurred with the original patch attempt.

Added additional regression test case provided by Joerg Sonnenberger.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 15004.Oct 16 2014, 3:41 AM
RKSimon retitled this revision from to [X86] Memory folding for commutative instructions (updated).
RKSimon updated this object.
RKSimon edited the test plan for this revision. (Show Details)
RKSimon added reviewers: qcolombet, andreadb, spatel, nadav.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added subscribers: Unknown Object (MLST), joerg, chapuni.
qcolombet edited edge metadata.Oct 16 2014, 11:30 AM

Hi Simon,

It seems you have a few 80-col violation.
With that fixed, LGTM.

Thanks,
-Quentin

RKSimon updated this revision to Diff 15094.Oct 17 2014, 12:13 PM
RKSimon edited edge metadata.

Memory folding patch - minor clean up

clang-format column fixes
renamed regression test to something more meaningful

Hi Simon,

Thanks for the update.
Few things I missed from the previous review on the regression test:

  • Please do not put the date in the file name.
  • Add some check lines (and add FileCheck on the run line) to be sure we generate reasonable code were it used to crash.

Sorry for missing that the first time.

Thanks,
-Quentin

RKSimon updated this revision to Diff 15122.Oct 18 2014, 10:23 AM

Memory folding patch - added filecheck tests to main regression test (renamed fold-tied-op.ll)

qcolombet accepted this revision.Oct 20 2014, 9:47 AM
qcolombet edited edge metadata.

Thanks Simon.

LGTM.

-Quentin

This revision is now accepted and ready to land.Oct 20 2014, 9:47 AM
RKSimon closed this revision.Oct 20 2014, 3:24 PM
RKSimon updated this revision to Diff 15156.

Closed by commit rL220239 (authored by @RKSimon).