This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use ADD/SUB instead of INC/DEC for Silvermont
ClosedPublic

Authored by volkalexey on Jun 2 2014, 7:28 AM.

Details

Summary

According to Intel Software Optimization Manual on Silvermont INC or DEC instructions
require an additional uop to merge the flags. As a result, a branch instruction depending on an INC or a DEC
instruction incurs a 1 cycle penalty.
This patch disables INC/DEC patterns for Silvermont under new feature flag "slow-incdec".

Diff Detail

Repository
rL LLVM

Event Timeline

volkalexey updated this revision to Diff 10015.Jun 2 2014, 7:28 AM
volkalexey retitled this revision from to [X86] Use ADD/SUB instead of INC/DEC 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 subscribers: Unknown Object (MLST), zinovy.nis.
joerg added a subscriber: joerg.Jun 2 2014, 7:59 AM

Are they actually slower than the corresponding add code?

Yes, the code with INC/DEC is actually slower on Silvermont than corresponding code with ADD.

volkalexey closed this revision.Jun 9 2014, 4:48 AM
volkalexey updated this revision to Diff 10237.

Closed by commit rL210466 (authored by volkalex).