This is an archive of the discontinued LLVM Phabricator instance.

[X86] Tune LEA usage for Silvermont
ClosedPublic

Authored by volkalexey on May 19 2014, 7:37 AM.

Details

Summary

According to Intel Software Optimization Manual on Silvermont in some cases LEA is better to be replaced with ADD instructions:
"The rule of thumb for ADDs and LEAs is that it is justified to use LEA with a valid index and/or displacement for non-destructive destination purposes (especially useful for stack offset cases), or to use a SCALE. Otherwise, ADD(s) are preferable."

Attached patch replaces such LEAs with ADD instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

volkalexey updated this revision to Diff 9571.May 19 2014, 7:37 AM
volkalexey retitled this revision from to [X86] Tune LEA usage for Silvermont.
volkalexey updated this object.
volkalexey edited the test plan for this revision. (Show Details)
volkalexey added a reviewer: nadav.
volkalexey set the repository for this revision to rL LLVM.
volkalexey added a subscriber: Unknown Object (MLST).
nadav edited edge metadata.May 19 2014, 9:29 AM

+ bool isSafeToClobberEFLAGS(MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator I) const;
+

Please document this function. Everything else LGTM.

volkalexey closed this revision.May 20 2014, 2:03 AM
volkalexey updated this revision to Diff 9599.

Closed by commit rL209198 (authored by volkalex).