This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add option for enabling LEA optimization pass
ClosedPublic

Authored by aturetsk on Dec 16 2015, 8:40 AM.

Details

Summary

Add option to enable/disable LEA optimization pass. By default the pass is disabled.

Diff Detail

Repository
rL LLVM

Event Timeline

aturetsk updated this revision to Diff 43014.Dec 16 2015, 8:40 AM
aturetsk retitled this revision from to [X86] Add option for enabling LEA optimization pass.
aturetsk updated this object.
aturetsk added a reviewer: qcolombet.
aturetsk added a subscriber: llvm-commits.

Out of curiosity, are there actually plans to make this faster?
(Since it would be non-ideal to have this disabled by default but in-tree
forever)

qcolombet accepted this revision.Dec 16 2015, 9:03 AM
qcolombet edited edge metadata.

LGTM plus what Daniel said!

Q.

This revision is now accepted and ready to land.Dec 16 2015, 9:03 AM

I'm going to investigate the compile time issue and try to find ways to improve pass's speed.
In the worst case we can just skip LEA optimization for big basic blocks, that should keep compile time from blowing up.

I'm going to investigate the compile time issue and try to find ways to improve pass's speed.
In the worst case we can just skip LEA optimization for big basic blocks, that should keep compile time from blowing up.

I would try the two things i suggested in the bug. They solve the main algorithmic complexity problems with this pass. I hacked up a patch to do them, and it completely solved the compile time issue, and i didn't see any regressions.

IMHO, We generally should only be inserting big-hammer compile time controls and random "stop after 10" style things if we can't reasonably make the algorithmic complexity better.
(among other reasons, we end up with a compiler that has sudden changes in optimization behavior depending on if your block has 999 instructions or 1000 instructions)

This revision was automatically updated to reflect the committed changes.