Skip to content

Commit

Permalink
[MC] Delete MCCodePadder
Browse files Browse the repository at this point in the history
D34393 added MCCodePadder as an infrastructure for padding code with
NOP instructions. It lacked tests and was not being worked on since
then.

Intel has now worked on an assembler patch to mitigate performance loss
after applying microcode update for the Jump Conditional Code Erratum.

https://www.intel.com/content/www/us/en/support/articles/000055650/processors.html

This new patch shares similarity with MCCodePadder, but has a concrete
use case in mind and is being actively developed. The infrastructure it
introduces can potentially be used for general performance improvement
via alignment. Delete the unused MCCodePadder so that people can develop
the new feature from a clean state.

Reviewed By: jyknight, skan

Differential Revision: https://reviews.llvm.org/D71106
  • Loading branch information
MaskRay committed Dec 10, 2019
1 parent 52b1c94 commit 9574757
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 880 deletions.
3 changes: 0 additions & 3 deletions llvm/include/llvm/CodeGen/AsmPrinter.h
Expand Up @@ -59,7 +59,6 @@ class MachineModuleInfo;
class MachineOptimizationRemarkEmitter;
class MCAsmInfo;
class MCCFIInstruction;
struct MCCodePaddingContext;
class MCContext;
class MCExpr;
class MCInst;
Expand Down Expand Up @@ -696,8 +695,6 @@ class AsmPrinter : public MachineFunctionPass {
GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy &S);
/// Emit GlobalAlias or GlobalIFunc.
void emitGlobalIndirectSymbol(Module &M, const GlobalIndirectSymbol &GIS);
void setupCodePaddingContext(const MachineBasicBlock &MBB,
MCCodePaddingContext &Context) const;
};

} // end namespace llvm
Expand Down
39 changes: 0 additions & 39 deletions llvm/include/llvm/MC/MCAsmBackend.h
Expand Up @@ -17,30 +17,25 @@
#include "llvm/MC/MCFragment.h"
#include "llvm/Support/Endian.h"
#include <cstdint>
#include <memory>

namespace llvm {

class MCAsmLayout;
class MCAssembler;
class MCCFIInstruction;
class MCCodePadder;
struct MCFixupKindInfo;
class MCFragment;
class MCInst;
class MCObjectStreamer;
class MCObjectTargetWriter;
class MCObjectWriter;
struct MCCodePaddingContext;
class MCRelaxableFragment;
class MCSubtargetInfo;
class MCValue;
class raw_pwrite_stream;

/// Generic interface to target specific assembler backends.
class MCAsmBackend {
std::unique_ptr<MCCodePadder> CodePadder;

protected: // Can only create subclasses.
MCAsmBackend(support::endianness Endian);

Expand Down Expand Up @@ -184,40 +179,6 @@ class MCAsmBackend {
virtual bool isMicroMips(const MCSymbol *Sym) const {
return false;
}

/// Handles all target related code padding when starting to write a new
/// basic block to an object file.
///
/// \param OS The streamer used for writing the padding data and function.
/// \param Context the context of the padding, Embeds the basic block's
/// parameters.
void handleCodePaddingBasicBlockStart(MCObjectStreamer *OS,
const MCCodePaddingContext &Context);
/// Handles all target related code padding after writing a block to an object
/// file.
///
/// \param Context the context of the padding, Embeds the basic block's
/// parameters.
void handleCodePaddingBasicBlockEnd(const MCCodePaddingContext &Context);
/// Handles all target related code padding before writing a new instruction
/// to an object file.
///
/// \param Inst the instruction.
void handleCodePaddingInstructionBegin(const MCInst &Inst);
/// Handles all target related code padding after writing an instruction to an
/// object file.
///
/// \param Inst the instruction.
void handleCodePaddingInstructionEnd(const MCInst &Inst);

/// Relaxes a fragment (changes the size of the padding) according to target
/// requirements. The new size computation is done w.r.t a layout.
///
/// \param PF The fragment to relax.
/// \param Layout Code layout information.
///
/// \returns true iff any relaxation occurred.
bool relaxFragment(MCPaddingFragment *PF, MCAsmLayout &Layout);
};

} // end namespace llvm
Expand Down
2 changes: 0 additions & 2 deletions llvm/include/llvm/MC/MCAssembler.h
Expand Up @@ -192,8 +192,6 @@ class MCAssembler {

bool relaxInstruction(MCAsmLayout &Layout, MCRelaxableFragment &IF);

bool relaxPaddingFragment(MCAsmLayout &Layout, MCPaddingFragment &PF);

bool relaxLEB(MCAsmLayout &Layout, MCLEBFragment &IF);

bool relaxDwarfLineAddr(MCAsmLayout &Layout, MCDwarfLineAddrFragment &DF);
Expand Down
241 changes: 0 additions & 241 deletions llvm/include/llvm/MC/MCCodePadder.h

This file was deleted.

0 comments on commit 9574757

Please sign in to comment.