From 9574757dba9d520a90252ba63b3d178e7d9ef00e Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 5 Dec 2019 18:18:55 -0800 Subject: [MC] Delete MCCodePadder 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 --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter') diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 0290eee82b7..a8e8d3f813d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -85,7 +85,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" #include "llvm/MC/MCAsmInfo.h" -#include "llvm/MC/MCCodePadder.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCDwarf.h" @@ -2923,21 +2922,6 @@ static void emitBasicBlockLoopComments(const MachineBasicBlock &MBB, PrintChildLoopComment(OS, Loop, AP.getFunctionNumber()); } -void AsmPrinter::setupCodePaddingContext(const MachineBasicBlock &MBB, - MCCodePaddingContext &Context) const { - assert(MF != nullptr && "Machine function must be valid"); - bool OptForSize = MF->getFunction().hasOptSize() || - llvm::shouldOptimizeForSize(&MBB, PSI, MBFI); - Context.IsPaddingActive = !MF->hasInlineAsm() && - !OptForSize && - TM.getOptLevel() != CodeGenOpt::None; - Context.IsBasicBlockReachableViaFallthrough = - std::find(MBB.pred_begin(), MBB.pred_end(), MBB.getPrevNode()) != - MBB.pred_end(); - Context.IsBasicBlockReachableViaBranch = - MBB.pred_size() > 0 && !isBlockOnlyReachableByFallthrough(&MBB); -} - /// EmitBasicBlockStart - This method prints the label for the specified /// MachineBasicBlock, an alignment (if present) and a comment describing /// it if appropriate. @@ -2954,9 +2938,6 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) { const Align Alignment = MBB.getAlignment(); if (Alignment != Align::None()) EmitAlignment(Alignment); - MCCodePaddingContext Context; - setupCodePaddingContext(MBB, Context); - OutStreamer->EmitCodePaddingBasicBlockStart(Context); // If the block has its address taken, emit any labels that were used to // reference the block. It is possible that there is more than one label @@ -3004,11 +2985,7 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) { } } -void AsmPrinter::EmitBasicBlockEnd(const MachineBasicBlock &MBB) { - MCCodePaddingContext Context; - setupCodePaddingContext(MBB, Context); - OutStreamer->EmitCodePaddingBasicBlockEnd(Context); -} +void AsmPrinter::EmitBasicBlockEnd(const MachineBasicBlock &MBB) {} void AsmPrinter::EmitVisibility(MCSymbol *Sym, unsigned Visibility, bool IsDefinition) const { -- cgit v1.2.3