diff options
| author | 2020-08-03 15:06:44 +0000 | |
|---|---|---|
| committer | 2020-08-03 15:06:44 +0000 | |
| commit | b64793999546ed8adebaeebd9d8345d18db8927d (patch) | |
| tree | 4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp | |
| parent | Add support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff) | |
| download | wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip | |
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp')
| -rw-r--r-- | gnu/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/gnu/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp b/gnu/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp deleted file mode 100644 index b263e9d86c4..00000000000 --- a/gnu/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp +++ /dev/null @@ -1,81 +0,0 @@ -//===--- ARMComputeBlockSize.cpp - Compute machine block sizes ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "ARM.h" -#include "ARMBaseInstrInfo.h" -#include "ARMBasicBlockInfo.h" -#include "ARMMachineFunctionInfo.h" -#include "llvm/CodeGen/MachineBasicBlock.h" -#include "llvm/CodeGen/MachineFunction.h" -#include "llvm/CodeGen/MachineInstr.h" -#include "llvm/CodeGen/TargetSubtargetInfo.h" -#include <vector> - -using namespace llvm; - -namespace llvm { - -// mayOptimizeThumb2Instruction - Returns true if optimizeThumb2Instructions -// below may shrink MI. -static bool -mayOptimizeThumb2Instruction(const MachineInstr *MI) { - switch(MI->getOpcode()) { - // optimizeThumb2Instructions. - case ARM::t2LEApcrel: - case ARM::t2LDRpci: - // optimizeThumb2Branches. - case ARM::t2B: - case ARM::t2Bcc: - case ARM::tBcc: - // optimizeThumb2JumpTables. - case ARM::t2BR_JT: - case ARM::tBR_JTr: - return true; - } - return false; -} - -void computeBlockSize(MachineFunction *MF, MachineBasicBlock *MBB, - BasicBlockInfo &BBI) { - const ARMBaseInstrInfo *TII = - static_cast<const ARMBaseInstrInfo *>(MF->getSubtarget().getInstrInfo()); - bool isThumb = MF->getInfo<ARMFunctionInfo>()->isThumbFunction(); - BBI.Size = 0; - BBI.Unalign = 0; - BBI.PostAlign = 0; - - for (MachineInstr &I : *MBB) { - BBI.Size += TII->getInstSizeInBytes(I); - // For inline asm, getInstSizeInBytes returns a conservative estimate. - // The actual size may be smaller, but still a multiple of the instr size. - if (I.isInlineAsm()) - BBI.Unalign = isThumb ? 1 : 2; - // Also consider instructions that may be shrunk later. - else if (isThumb && mayOptimizeThumb2Instruction(&I)) - BBI.Unalign = 1; - } - - // tBR_JTr contains a .align 2 directive. - if (!MBB->empty() && MBB->back().getOpcode() == ARM::tBR_JTr) { - BBI.PostAlign = 2; - MBB->getParent()->ensureAlignment(2); - } -} - -std::vector<BasicBlockInfo> computeAllBlockSizes(MachineFunction *MF) { - std::vector<BasicBlockInfo> BBInfo; - BBInfo.resize(MF->getNumBlockIDs()); - - for (MachineBasicBlock &MBB : *MF) - computeBlockSize(MF, &MBB, BBInfo[MBB.getNumber()]); - - return BBInfo; -} - -} // end namespace llvm |
