[PATCH] [X86] Use ADD/SUB instead of INC/DEC for Haswell and Broadwell CPUs

Alexey Volkov avolkov.intel at gmail.com
Fri Nov 14 04:18:23 PST 2014


This test is for feature slow-incdec which is enabled also for Silvermont, KNL and SKX.
I see from other tests that this is common practice to test features itself and not to test that CPU has some feature.

I didn't see major performance impact due to this change, only small improvements on some SPEC2000 tests (by 1-2%).
I enabled this feature per Intel optimization manual:
Assembly/Compiler Coding Rule33. (M impact, H generality)INC and DEC instructions should 
be replaced with ADD or SUB instructions, because ADD and SUB overwrite all flags, whereas INC and 
DEC do not, therefore creating false dependencies on earlier instructions that set the flags.

Also GCC avoids generation of INC/DEC and uses ADD and SUB.

http://reviews.llvm.org/D5934






More information about the llvm-commits mailing list