The current X86 NOP padding uses one long NOP followed by the remainder in
authorDavid Sehr <sehr@google.com>
Tue, 5 Mar 2013 00:02:23 +0000 (00:02 +0000)
committerDavid Sehr <sehr@google.com>
Tue, 5 Mar 2013 00:02:23 +0000 (00:02 +0000)
commit6c4265a541c9e431961113c1a5d92fb4628bfe13
treeb98b6adf1f9527b4ca89e194005765c3cc0b0ccf
parent880e8c0ad41345f353b819c51092baa8f05e1950
The current X86 NOP padding uses one long NOP followed by the remainder in
one-byte NOPs.  If the processor actually executes those NOPs, as it sometimes
does with aligned bundling, this can have a performance impact.  From my
micro-benchmarks run on my one machine, a 15-byte NOP followed by twelve
one-byte NOPs is about 20% worse than a 15 followed by a 12.  This patch
changes NOP emission to emit as many 15-byte (the maximum) as possible followed
by at most one shorter NOP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176464 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
test/MC/X86/AlignedBundling/long-nop-pad.s [new file with mode: 0644]