003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/lib/Target/ARM
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
lib
/
Target
/
ARM
/
📁
..
📄
A15SDOptimizer.cpp
(24.01 KB)
📄
ARM.h
(2.78 KB)
📄
ARM.td
(73.6 KB)
📄
ARMAsmPrinter.cpp
(80.17 KB)
📄
ARMAsmPrinter.h
(5.74 KB)
📄
ARMBaseInstrInfo.cpp
(209.03 KB)
📄
ARMBaseInstrInfo.h
(36.07 KB)
📄
ARMBaseRegisterInfo.cpp
(34.2 KB)
📄
ARMBaseRegisterInfo.h
(7.84 KB)
📄
ARMBasicBlockInfo.cpp
(5.18 KB)
📄
ARMBasicBlockInfo.h
(5.25 KB)
📄
ARMCallLowering.cpp
(19.74 KB)
📄
ARMCallLowering.h
(1.89 KB)
📄
ARMCallingConv.cpp
(11.8 KB)
📄
ARMCallingConv.h
(2.43 KB)
📄
ARMCallingConv.td
(14.63 KB)
📄
ARMConstantIslandPass.cpp
(90.84 KB)
📄
ARMConstantPoolValue.cpp
(11.53 KB)
📄
ARMConstantPoolValue.h
(10.1 KB)
📄
ARMExpandPseudoInsts.cpp
(115.56 KB)
📄
ARMFastISel.cpp
(106.14 KB)
📄
ARMFeatures.h
(2.48 KB)
📄
ARMFrameLowering.cpp
(102.32 KB)
📄
ARMFrameLowering.h
(4.02 KB)
📄
ARMHazardRecognizer.cpp
(3.41 KB)
📄
ARMHazardRecognizer.h
(1.54 KB)
📄
ARMISelDAGToDAG.cpp
(206.42 KB)
📄
ARMISelLowering.cpp
(728.6 KB)
📄
ARMISelLowering.h
(38.98 KB)
📄
ARMInstrCDE.td
(24.04 KB)
📄
ARMInstrFormats.td
(93.92 KB)
📄
ARMInstrInfo.cpp
(4.2 KB)
📄
ARMInstrInfo.h
(1.49 KB)
📄
ARMInstrInfo.td
(243.51 KB)
📄
ARMInstrMVE.td
(299.67 KB)
📄
ARMInstrNEON.td
(436.25 KB)
📄
ARMInstrThumb.td
(65.92 KB)
📄
ARMInstrThumb2.td
(211.06 KB)
📄
ARMInstrVFP.td
(110.46 KB)
📄
ARMInstructionSelector.cpp
(39.12 KB)
📄
ARMLegalizerInfo.cpp
(18.8 KB)
📄
ARMLegalizerInfo.h
(2.41 KB)
📄
ARMLoadStoreOptimizer.cpp
(94.44 KB)
📄
ARMLowOverheadLoops.cpp
(60.28 KB)
📄
ARMMCInstLower.cpp
(7.2 KB)
📄
ARMMachineFunctionInfo.cpp
(821 B)
📄
ARMMachineFunctionInfo.h
(9.68 KB)
📄
ARMMacroFusion.cpp
(2.36 KB)
📄
ARMMacroFusion.h
(966 B)
📄
ARMOptimizeBarriersPass.cpp
(3.43 KB)
📄
ARMParallelDSP.cpp
(26.82 KB)
📄
ARMPerfectShuffle.h
(382.02 KB)
📄
ARMPredicates.td
(14.16 KB)
📄
ARMRegisterBankInfo.cpp
(18.18 KB)
📄
ARMRegisterBankInfo.h
(1.41 KB)
📄
ARMRegisterBanks.td
(577 B)
📄
ARMRegisterInfo.cpp
(685 B)
📄
ARMRegisterInfo.h
(845 B)
📄
ARMRegisterInfo.td
(24.53 KB)
📄
ARMSchedule.td
(15.13 KB)
📄
ARMScheduleA57.td
(62.61 KB)
📄
ARMScheduleA57WriteRes.td
(11.43 KB)
📄
ARMScheduleA8.td
(49.59 KB)
📄
ARMScheduleA9.td
(130.35 KB)
📄
ARMScheduleM4.td
(4.77 KB)
📄
ARMScheduleR52.td
(44.27 KB)
📄
ARMScheduleSwift.td
(50.53 KB)
📄
ARMScheduleV6.td
(12.34 KB)
📄
ARMSelectionDAGInfo.cpp
(9.21 KB)
📄
ARMSelectionDAGInfo.h
(2.81 KB)
📄
ARMSubtarget.cpp
(16.73 KB)
📄
ARMSubtarget.h
(31.56 KB)
📄
ARMSystemRegister.td
(5.42 KB)
📄
ARMTargetMachine.cpp
(19.74 KB)
📄
ARMTargetMachine.h
(3.48 KB)
📄
ARMTargetObjectFile.cpp
(3.75 KB)
📄
ARMTargetObjectFile.h
(1.67 KB)
📄
ARMTargetTransformInfo.cpp
(63.49 KB)
📄
ARMTargetTransformInfo.h
(10.22 KB)
📁
AsmParser
📁
Disassembler
📁
MCTargetDesc
📄
MLxExpansionPass.cpp
(11.56 KB)
📄
MVEGatherScatterLowering.cpp
(40.3 KB)
📄
MVETailPredication.cpp
(23.2 KB)
📄
MVEVPTBlockPass.cpp
(10.77 KB)
📄
MVEVPTOptimisationsPass.cpp
(16.46 KB)
📁
TargetInfo
📄
Thumb1FrameLowering.cpp
(39.45 KB)
📄
Thumb1FrameLowering.h
(3.48 KB)
📄
Thumb1InstrInfo.cpp
(5.73 KB)
📄
Thumb1InstrInfo.h
(2.38 KB)
📄
Thumb2ITBlockPass.cpp
(9.09 KB)
📄
Thumb2InstrInfo.cpp
(26.43 KB)
📄
Thumb2InstrInfo.h
(3.75 KB)
📄
Thumb2SizeReduction.cpp
(40.25 KB)
📄
ThumbRegisterInfo.cpp
(21.75 KB)
📄
ThumbRegisterInfo.h
(2.44 KB)
📁
Utils
Editing: ARMBasicBlockInfo.h
//===-- ARMBasicBlockInfo.h - Basic Block Information -----------*- C++ -*-===// // // 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 // //===----------------------------------------------------------------------===// // // Utility functions and data structure for computing block size. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_ARM_ARMBASICBLOCKINFO_H #define LLVM_LIB_TARGET_ARM_ARMBASICBLOCKINFO_H #include "ARMBaseInstrInfo.h" #include "ARMMachineFunctionInfo.h" #include "llvm/Support/MathExtras.h" #include <algorithm> #include <cstdint> namespace llvm { struct BasicBlockInfo; using BBInfoVector = SmallVectorImpl<BasicBlockInfo>; /// UnknownPadding - Return the worst case padding that could result from /// unknown offset bits. This does not include alignment padding caused by /// known offset bits. /// /// @param Alignment alignment /// @param KnownBits Number of known low offset bits. inline unsigned UnknownPadding(Align Alignment, unsigned KnownBits) { if (KnownBits < Log2(Alignment)) return Alignment.value() - (1ull << KnownBits); return 0; } /// BasicBlockInfo - Information about the offset and size of a single /// basic block. struct BasicBlockInfo { /// Offset - Distance from the beginning of the function to the beginning /// of this basic block. /// /// Offsets are computed assuming worst case padding before an aligned /// block. This means that subtracting basic block offsets always gives a /// conservative estimate of the real distance which may be smaller. /// /// Because worst case padding is used, the computed offset of an aligned /// block may not actually be aligned. unsigned Offset = 0; /// Size - Size of the basic block in bytes. If the block contains /// inline assembly, this is a worst case estimate. /// /// The size does not include any alignment padding whether from the /// beginning of the block, or from an aligned jump table at the end. unsigned Size = 0; /// KnownBits - The number of low bits in Offset that are known to be /// exact. The remaining bits of Offset are an upper bound. uint8_t KnownBits = 0; /// Unalign - When non-zero, the block contains instructions (inline asm) /// of unknown size. The real size may be smaller than Size bytes by a /// multiple of 1 << Unalign. uint8_t Unalign = 0; /// PostAlign - When > 1, the block terminator contains a .align /// directive, so the end of the block is aligned to PostAlign bytes. Align PostAlign; BasicBlockInfo() = default; /// Compute the number of known offset bits internally to this block. /// This number should be used to predict worst case padding when /// splitting the block. unsigned internalKnownBits() const { unsigned Bits = Unalign ? Unalign : KnownBits; // If the block size isn't a multiple of the known bits, assume the // worst case padding. if (Size & ((1u << Bits) - 1)) Bits = countTrailingZeros(Size); return Bits; } /// Compute the offset immediately following this block. If Align is /// specified, return the offset the successor block will get if it has /// this alignment. unsigned postOffset(Align Alignment = Align(1)) const { unsigned PO = Offset + Size; const Align PA = std::max(PostAlign, Alignment); if (PA == Align(1)) return PO; // Add alignment padding from the terminator. return PO + UnknownPadding(PA, internalKnownBits()); } /// Compute the number of known low bits of postOffset. If this block /// contains inline asm, the number of known bits drops to the /// instruction alignment. An aligned terminator may increase the number /// of know bits. /// If LogAlign is given, also consider the alignment of the next block. unsigned postKnownBits(Align Align = llvm::Align(1)) const { return std::max(Log2(std::max(PostAlign, Align)), internalKnownBits()); } }; class ARMBasicBlockUtils { private: MachineFunction &MF; bool isThumb = false; const ARMBaseInstrInfo *TII = nullptr; SmallVector<BasicBlockInfo, 8> BBInfo; public: ARMBasicBlockUtils(MachineFunction &MF) : MF(MF) { TII = static_cast<const ARMBaseInstrInfo*>(MF.getSubtarget().getInstrInfo()); isThumb = MF.getInfo<ARMFunctionInfo>()->isThumbFunction(); } void computeAllBlockSizes() { BBInfo.resize(MF.getNumBlockIDs()); for (MachineBasicBlock &MBB : MF) computeBlockSize(&MBB); } void computeBlockSize(MachineBasicBlock *MBB); unsigned getOffsetOf(MachineInstr *MI) const; unsigned getOffsetOf(MachineBasicBlock *MBB) const { return BBInfo[MBB->getNumber()].Offset; } void adjustBBOffsetsAfter(MachineBasicBlock *MBB); void adjustBBSize(MachineBasicBlock *MBB, int Size) { BBInfo[MBB->getNumber()].Size += Size; } bool isBBInRange(MachineInstr *MI, MachineBasicBlock *DestBB, unsigned MaxDisp) const; void insert(unsigned BBNum, BasicBlockInfo BBI) { BBInfo.insert(BBInfo.begin() + BBNum, BBI); } void clear() { BBInfo.clear(); } BBInfoVector &getBBInfo() { return BBInfo; } }; } // end namespace llvm #endif // LLVM_LIB_TARGET_ARM_ARMBASICBLOCKINFO_H
Upload File
Create Folder