[llvm-dev] X86PadShortFunction.cpp inserts noops twice

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 1 09:36:38 PDT 2017


On 1 August 2017 at 01:04, Serguei Katkov via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> What is the reason to add two noops? What am I missing?

It does seem to be intentional (looking at the test) so my guess is
that it's because the Atom is dual-issue (i.e. executes 2 instructions
per cycle).

The early part of the calculation and wording of the problem (in
r171879) seems to be in cycles and then this code (with the misnamed
"NOOPsToAdd") gets called to use up some number of them. Emitting 2
NOPs probably consumes both pipelines for 1 cycle.

Cheers.

Tim.


More information about the llvm-dev mailing list