diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-12-20 19:53:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-12-20 19:53:05 +0000 |
commit | 0b57cec536236d46e3dba9bd041533462f33dbb7 (patch) | |
tree | 56229dbdbbf76d18580f72f789003db17246c8d9 /contrib/llvm/lib/Target/ARM/ARMMacroFusion.cpp | |
parent | 718ef55ec7785aae63f98f8ca05dc07ed399c16d (diff) |
Move all sources from the llvm project into contrib/llvm-project.
This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.
Updating the vendor area to match this layout is next.
Notes
Notes:
svn path=/head/; revision=355940
Diffstat (limited to 'contrib/llvm/lib/Target/ARM/ARMMacroFusion.cpp')
-rw-r--r-- | contrib/llvm/lib/Target/ARM/ARMMacroFusion.cpp | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/contrib/llvm/lib/Target/ARM/ARMMacroFusion.cpp b/contrib/llvm/lib/Target/ARM/ARMMacroFusion.cpp deleted file mode 100644 index 38bf28ba8219..000000000000 --- a/contrib/llvm/lib/Target/ARM/ARMMacroFusion.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===- ARMMacroFusion.cpp - ARM Macro Fusion ----------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -/// \file This file contains the ARM implementation of the DAG scheduling -/// mutation to pair instructions back to back. -// -//===----------------------------------------------------------------------===// - -#include "ARMMacroFusion.h" -#include "ARMSubtarget.h" -#include "llvm/CodeGen/MacroFusion.h" -#include "llvm/CodeGen/TargetInstrInfo.h" - -namespace llvm { - -// Fuse AES crypto encoding or decoding. -static bool isAESPair(const MachineInstr *FirstMI, - const MachineInstr &SecondMI) { - // Assume the 1st instr to be a wildcard if it is unspecified. - switch(SecondMI.getOpcode()) { - // AES encode. - case ARM::AESMC : - return FirstMI == nullptr || FirstMI->getOpcode() == ARM::AESE; - // AES decode. - case ARM::AESIMC: - return FirstMI == nullptr || FirstMI->getOpcode() == ARM::AESD; - } - - return false; -} - -// Fuse literal generation. -static bool isLiteralsPair(const MachineInstr *FirstMI, - const MachineInstr &SecondMI) { - // Assume the 1st instr to be a wildcard if it is unspecified. - if ((FirstMI == nullptr || FirstMI->getOpcode() == ARM::MOVi16) && - SecondMI.getOpcode() == ARM::MOVTi16) - return true; - - return false; -} - -/// Check if the instr pair, FirstMI and SecondMI, should be fused -/// together. Given SecondMI, when FirstMI is unspecified, then check if -/// SecondMI may be part of a fused pair at all. -static bool shouldScheduleAdjacent(const TargetInstrInfo &TII, - const TargetSubtargetInfo &TSI, - const MachineInstr *FirstMI, - const MachineInstr &SecondMI) { - const ARMSubtarget &ST = static_cast<const ARMSubtarget&>(TSI); - - if (ST.hasFuseAES() && isAESPair(FirstMI, SecondMI)) - return true; - if (ST.hasFuseLiterals() && isLiteralsPair(FirstMI, SecondMI)) - return true; - - return false; -} - -std::unique_ptr<ScheduleDAGMutation> createARMMacroFusionDAGMutation () { - return createMacroFusionDAGMutation(shouldScheduleAdjacent); -} - -} // end namespace llvm |