llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[X86] 32-byte alignment of small loops

Open serguei-katkov opened this issue 9 years ago • 2 comments

Bugzilla Link 33307
Version trunk
OS Windows NT
CC @RKSimon,@rotateright,@ZviRackover

Extended Description

X86 optimization guide directly states that 32-byte alignment of small loops may benefit from LSD(Loop Stream Detector) if some condition are met.

It seems that X86 LLVM backend does nothing related to this. It would be nice to implement this optimization to speed-up execution of small loops.

serguei-katkov avatar Jun 05 '17 04:06 serguei-katkov

https://stackoverflow.com/questions/25958649/code-alignment-in-one-object-file-is-affecting-the-performance-of-a-function-in/26003659#26003659

llvmbot avatar Sep 11 '17 03:09 llvmbot

Code with small loops should be aligned on 16-byte boundaries and code with loops that do not fit in the prefetch should be aligned on 32-byte boundaries.

aligning as 32-byte will make your codes more slower. this will cause nop cost, cache misses, ITLB misses

and rarly, CPUs that has no uop cache will not available to run on loop buffer.

llvmbot avatar Sep 11 '17 03:09 llvmbot