[llvm-dev] X86PadShortFunction.cpp inserts noops twice

Serguei Katkov via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 1 01:04:16 PDT 2017


Hi,

while taking a look at X86PadShortFunction.cpp I found that

/// addPadding - Add the given number of NOOP instructions to the function
/// just prior to the return at MBBI
void PadShortFunc::addPadding(MachineBasicBlock *MBB,
                              MachineBasicBlock::iterator &MBBI,
                              unsigned int NOOPsToAdd) {
  DebugLoc DL = MBBI->getDebugLoc();

  while (NOOPsToAdd-- > 0) {
    BuildMI(*MBB, MBBI, DL, TII->get(X86::NOOP));
    BuildMI(*MBB, MBBI, DL, TII->get(X86::NOOP));
  }

What is the reason to add two noops? What am I missing?

Thank you,
Serguei.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170801/aecb80db/attachment.html>


More information about the llvm-dev mailing list