|
LLVM 24.0.0git
|
#include "AArch64InstrInfo.h"#include "AArch64ExpandImm.h"#include "AArch64MachineFunctionInfo.h"#include "AArch64PointerAuth.h"#include "AArch64Subtarget.h"#include "MCTargetDesc/AArch64AddressingModes.h"#include "MCTargetDesc/AArch64MCLFIRewriter.h"#include "MCTargetDesc/AArch64MCTargetDesc.h"#include "Utils/AArch64BaseInfo.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/CodeGen/CFIInstBuilder.h"#include "llvm/CodeGen/LivePhysRegs.h"#include "llvm/CodeGen/LiveRegUnits.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineCombinerPattern.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstr.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineMemOperand.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/MachineOperand.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/RegisterScavenging.h"#include "llvm/CodeGen/StackMaps.h"#include "llvm/CodeGen/TargetRegisterInfo.h"#include "llvm/CodeGen/TargetSubtargetInfo.h"#include "llvm/IR/DebugInfoMetadata.h"#include "llvm/IR/DebugLoc.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/Module.h"#include "llvm/MC/MCAsmInfo.h"#include "llvm/MC/MCInst.h"#include "llvm/MC/MCInstBuilder.h"#include "llvm/MC/MCInstrDesc.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CodeGen.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/LEB128.h"#include "llvm/Support/MathExtras.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetOptions.h"#include <cassert>#include <cstdint>#include <iterator>#include <utility>#include "AArch64GenInstrInfo.inc"Go to the source code of this file.
Macros | |
| #define | GET_INSTRINFO_CTOR_DTOR |
| #define | DEBUG_TYPE "AArch64InstrInfo" |
| #define | GET_INSTRINFO_HELPERS |
| #define | GET_INSTRMAP_INFO |
Enumerations | |
| enum | AccessKind { AK_Write = 0x01 , AK_Read = 0x10 , AK_All = 0x11 } |
| enum class | FMAInstKind { Default , Indexed , Accumulator } |
| enum | MachineOutlinerClass { MachineOutlinerDefault , MachineOutlinerTailCall , MachineOutlinerNoLRSave , MachineOutlinerThunk , MachineOutlinerRegSave } |
| Constants defining how certain sequences should be outlined. More... | |
| enum | MachineOutlinerMBBFlags { LRUnavailableSomewhere = 0x2 , HasCalls = 0x4 , UnsafeRegsDead = 0x8 } |
Functions | |
| STATISTIC (NumCopyInstrs, "Number of COPY instructions expanded") | |
| STATISTIC (NumZCRegMoveInstrsGPR, "Number of zero-cycle GPR register move " "instructions expanded from canonical COPY") | |
| STATISTIC (NumZCRegMoveInstrsFPR, "Number of zero-cycle FPR register move " "instructions expanded from canonical COPY") | |
| STATISTIC (NumZCZeroingInstrsGPR, "Number of zero-cycle GPR zeroing " "instructions expanded from canonical COPY") | |
| static std::optional< unsigned > | getLFIInstSizeInBytes (const MachineInstr &MI) |
| Return the maximum number of bytes of code the specified instruction may be after LFI rewriting. | |
| static void | parseCondBranch (MachineInstr *LastInst, MachineBasicBlock *&Target, SmallVectorImpl< MachineOperand > &Cond) |
| static unsigned | getBranchDisplacementBits (unsigned Opc) |
| static unsigned | removeCopies (const MachineRegisterInfo &MRI, unsigned VReg) |
| static unsigned | canFoldIntoCSel (const MachineRegisterInfo &MRI, unsigned VReg, unsigned *NewReg=nullptr) |
| static bool | isCheapImmediate (const MachineInstr &MI, unsigned BitSize) |
| static bool | isCheapCopy (const MachineInstr &MI, const AArch64RegisterInfo &RI) |
| static bool | UpdateOperandRegClass (MachineInstr &Instr) |
| static unsigned | convertToNonFlagSettingOpc (const MachineInstr &MI) |
| Return the opcode that does not set flags when possible - otherwise return the original opcode. | |
| static bool | areCFlagsAccessedBetweenInstrs (MachineBasicBlock::iterator From, MachineBasicBlock::iterator To, const TargetRegisterInfo *TRI, const AccessKind AccessToCheck=AK_All) |
| True when condition flags are accessed (either by writing or reading) on the instruction trace starting at From and ending at To. | |
| static unsigned | sForm (MachineInstr &Instr) |
| Get opcode of S version of Instr. | |
| static bool | areCFlagsAliveInSuccessors (const MachineBasicBlock *MBB) |
| Check if AArch64::NZCV should be alive in successors of MBB. | |
| static AArch64CC::CondCode | findCondCodeUsedByInstr (const MachineInstr &Instr) |
| Find a condition code used by the instruction. | |
| static UsedNZCV | getUsedNZCV (AArch64CC::CondCode CC) |
| static bool | isADDSRegImm (unsigned Opcode) |
| static bool | isSUBSRegImm (unsigned Opcode) |
| static bool | isANDOpcode (MachineInstr &MI) |
| static bool | canInstrSubstituteCmpInstr (MachineInstr &MI, MachineInstr &CmpInstr, const TargetRegisterInfo &TRI) |
| Check if CmpInstr can be substituted by MI. | |
| static bool | canCmpInstrBeRemoved (MachineInstr &MI, MachineInstr &CmpInstr, int CmpValue, const TargetRegisterInfo &TRI, SmallVectorImpl< MachineInstr * > &CCUseInstrs, bool &IsInvertCC) |
| static bool | isFrameLoadOpcode (int Opcode) |
| static bool | isFrameStoreOpcode (int Opcode) |
| static unsigned | regOffsetOpcode (unsigned Opcode) |
| unsigned | scaledOffsetOpcode (unsigned Opcode, unsigned &Scale) |
| unsigned | unscaledOffsetOpcode (unsigned Opcode) |
| static unsigned | offsetExtendOpcode (unsigned Opcode) |
| static bool | isPostIndexLdStOpcode (unsigned Opcode) |
| Return true if the opcode is a post-index ld/st instruction, which really loads from base+0. | |
| static const TargetRegisterClass * | getRegClass (const MachineInstr &MI, Register Reg) |
| static bool | scaleOffset (unsigned Opc, int64_t &Offset) |
| static bool | canPairLdStOpc (unsigned FirstOpc, unsigned SecondOpc) |
| static bool | shouldClusterFI (const MachineFrameInfo &MFI, int FI1, int64_t Offset1, unsigned Opcode1, int FI2, int64_t Offset2, unsigned Opcode2) |
| static const MachineInstrBuilder & | AddSubReg (const MachineInstrBuilder &MIB, MCRegister Reg, unsigned SubIdx, RegState State, const TargetRegisterInfo *TRI) |
| static bool | forwardCopyWillClobberTuple (unsigned DestReg, unsigned SrcReg, unsigned NumRegs) |
| static bool | isInStreamingCallSiteRegion (MachineBasicBlock &MBB, MachineBasicBlock::iterator I) |
| Returns true if the instruction at I is in a streaming call site region, within a single basic block. | |
| static bool | mustAvoidNeonAtMBBI (const AArch64Subtarget &Subtarget, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) |
| Returns true if in a streaming call site region without SME-FA64. | |
| static void | storeRegPairToStackSlot (const TargetRegisterInfo &TRI, MachineBasicBlock &MBB, MachineBasicBlock::iterator InsertBefore, const MCInstrDesc &MCID, Register SrcReg, bool IsKill, unsigned SubIdx0, unsigned SubIdx1, int FI, MachineMemOperand *MMO) |
| static void | loadRegPairFromStackSlot (const TargetRegisterInfo &TRI, MachineBasicBlock &MBB, MachineBasicBlock::iterator InsertBefore, const MCInstrDesc &MCID, Register DestReg, unsigned SubIdx0, unsigned SubIdx1, int FI, MachineMemOperand *MMO) |
| static void | appendConstantExpr (SmallVectorImpl< char > &Expr, int64_t Constant, dwarf::LocationAtom Operation) |
| static void | appendReadRegExpr (SmallVectorImpl< char > &Expr, unsigned RegNum) |
| static void | appendLoadRegExpr (SmallVectorImpl< char > &Expr, int64_t OffsetFromDefCFA) |
| static void | appendOffsetComment (int NumBytes, llvm::raw_string_ostream &Comment, StringRef RegScale={}) |
| static MCCFIInstruction | createDefCFAExpression (const TargetRegisterInfo &TRI, unsigned Reg, const StackOffset &Offset) |
| static void | emitFrameOffsetAdj (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, int64_t Offset, unsigned Opc, const TargetInstrInfo *TII, MachineInstr::MIFlag Flag, bool NeedsWinCFI, bool *HasWinCFI, bool EmitCFAOffset, StackOffset CFAOffset, unsigned FrameReg) |
| static bool | isCombineInstrSettingFlag (unsigned Opc) |
| static bool | isCombineInstrCandidate32 (unsigned Opc) |
| static bool | isCombineInstrCandidate64 (unsigned Opc) |
| static bool | isCombineInstrCandidateFP (const MachineInstr &Inst) |
| static bool | isCombineInstrCandidate (unsigned Opc) |
| static bool | canCombine (MachineBasicBlock &MBB, MachineOperand &MO, unsigned CombineOpc, unsigned ZeroReg=0, bool CheckZeroReg=false) |
| static bool | canCombineWithMUL (MachineBasicBlock &MBB, MachineOperand &MO, unsigned MulOpc, unsigned ZeroReg) |
| static bool | canCombineWithFMUL (MachineBasicBlock &MBB, MachineOperand &MO, unsigned MulOpc) |
| static bool | getMaddPatterns (MachineInstr &Root, SmallVectorImpl< unsigned > &Patterns) |
| Find instructions that can be turned into madd. | |
| static bool | getFMAPatterns (MachineInstr &Root, SmallVectorImpl< unsigned > &Patterns) |
| Floating-Point Support. | |
| static bool | getFMULPatterns (MachineInstr &Root, SmallVectorImpl< unsigned > &Patterns) |
| static bool | getFNEGPatterns (MachineInstr &Root, SmallVectorImpl< unsigned > &Patterns) |
| static bool | getMiscPatterns (MachineInstr &Root, SmallVectorImpl< unsigned > &Patterns) |
| Find other MI combine patterns. | |
| static bool | getGatherLanePattern (MachineInstr &Root, SmallVectorImpl< unsigned > &Patterns, unsigned LoadLaneOpCode, unsigned NumLanes) |
| Check if the given instruction forms a gather load pattern that can be optimized for better Memory-Level Parallelism (MLP). | |
| static bool | getLoadPatterns (MachineInstr &Root, SmallVectorImpl< unsigned > &Patterns) |
| Search for patterns of LD instructions we can optimize. | |
| static void | generateGatherLanePattern (MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, SmallVectorImpl< MachineInstr * > &DelInstrs, DenseMap< Register, unsigned > &InstrIdxForVirtReg, unsigned Pattern, unsigned NumLanes) |
| Generate optimized instruction sequence for gather load patterns to improve Memory-Level Parallelism (MLP). | |
| static MachineInstr * | genFusedMultiply (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxMulOpd, unsigned MaddOpc, const TargetRegisterClass *RC, FMAInstKind kind=FMAInstKind::Default, const Register *ReplacedAddend=nullptr) |
| genFusedMultiply - Generate fused multiply instructions. | |
| static MachineInstr * | genFNegatedMAD (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs) |
| static MachineInstr * | genIndexedMultiply (MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxDupOp, unsigned MulOpc, const TargetRegisterClass *RC, MachineRegisterInfo &MRI) |
| Fold (FMUL x (DUP y lane)) into (FMUL_indexed x y lane) | |
| static MachineInstr * | genFusedMultiplyAcc (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxMulOpd, unsigned MaddOpc, const TargetRegisterClass *RC) |
| genFusedMultiplyAcc - Helper to generate fused multiply accumulate instructions. | |
| static Register | genNeg (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, DenseMap< Register, unsigned > &InstrIdxForVirtReg, unsigned MnegOpc, const TargetRegisterClass *RC) |
| genNeg - Helper to generate an intermediate negation of the second operand of Root | |
| static MachineInstr * | genFusedMultiplyAccNeg (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, DenseMap< Register, unsigned > &InstrIdxForVirtReg, unsigned IdxMulOpd, unsigned MaddOpc, unsigned MnegOpc, const TargetRegisterClass *RC) |
| genFusedMultiplyAccNeg - Helper to generate fused multiply accumulate instructions with an additional negation of the accumulator | |
| static MachineInstr * | genFusedMultiplyIdx (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxMulOpd, unsigned MaddOpc, const TargetRegisterClass *RC) |
| genFusedMultiplyIdx - Helper to generate fused multiply accumulate instructions. | |
| static MachineInstr * | genFusedMultiplyIdxNeg (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, DenseMap< Register, unsigned > &InstrIdxForVirtReg, unsigned IdxMulOpd, unsigned MaddOpc, unsigned MnegOpc, const TargetRegisterClass *RC) |
| genFusedMultiplyAccNeg - Helper to generate fused multiply accumulate instructions with an additional negation of the accumulator | |
| static MachineInstr * | genMaddR (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxMulOpd, unsigned MaddOpc, unsigned VR, const TargetRegisterClass *RC) |
| genMaddR - Generate madd instruction and combine mul and add using an extra virtual register Example - an ADD intermediate needs to be stored in a register: MUL I=A,B,0 ADD R,I,Imm ==> ORR V, ZR, Imm ==> MADD R,A,B,V | |
| static void | genSubAdd2SubSub (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, SmallVectorImpl< MachineInstr * > &DelInstrs, unsigned IdxOpd1, DenseMap< Register, unsigned > &InstrIdxForVirtReg) |
| Do the following transformation A - (B + C) ==> (A - B) - C A - (B + C) ==> (A - C) - B. | |
| static bool | isCompactUnwindFrameRecordEnabled (const MachineFunction &MF) |
Return true if the frame-record form of the outlined prologue is enabled for the target of MF. | |
| static bool | shouldUseCompactUnwindFrameRecordForOutlinedFunction (const MachineBasicBlock &MBB) |
Return true if the outlined function in MBB should save FP and LR as a frame record instead of saving LR alone. | |
| static bool | predictCompactUnwindFrameRecordForOutlinedFunction (std::vector< outliner::Candidate > &RepeatedSequenceLocs, const TargetRegisterInfo &TRI) |
| Predict what the above will answer, for use while costing candidates. | |
| static bool | outliningCandidatesSigningScopeConsensus (const outliner::Candidate &a, const outliner::Candidate &b) |
| static bool | outliningCandidatesSigningKeyConsensus (const outliner::Candidate &a, const outliner::Candidate &b) |
| static bool | outliningCandidatesV8_3OpsConsensus (const outliner::Candidate &a, const outliner::Candidate &b) |
| static void | signOutlinedFunction (MachineFunction &MF, MachineBasicBlock &MBB, const AArch64InstrInfo *TII, bool ShouldSignReturnAddr) |
| static std::optional< ParamLoadedValue > | describeORRLoadedValue (const MachineInstr &MI, Register DescribedReg, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) |
If the given ORR instruction is a copy, and DescribedReg overlaps with the destination register then, if possible, describe the value in terms of the source register. | |
| static Register | cloneInstr (const MachineInstr *MI, unsigned ReplaceOprNum, Register ReplaceReg, MachineBasicBlock &MBB, MachineBasicBlock::iterator InsertTo) |
| Clone an instruction from MI. | |
| static void | extractPhiReg (const MachineInstr &Phi, const MachineBasicBlock *MBB, Register &RegMBB, Register &RegOther) |
| static bool | isDefinedOutside (Register Reg, const MachineBasicBlock *BB) |
| static bool | getIndVarInfo (Register Reg, const MachineBasicBlock *LoopBB, MachineInstr *&UpdateInst, unsigned &UpdateCounterOprNum, Register &InitReg, bool &IsUpdatePriorComp) |
| If Reg is an induction variable, return true and set some parameters. | |
Variables | |
| static cl::opt< unsigned > | CBDisplacementBits ("aarch64-cb-offset-bits", cl::Hidden, cl::init(9), cl::desc("Restrict range of CB instructions (DEBUG)")) |
| static cl::opt< unsigned > | TBZDisplacementBits ("aarch64-tbz-offset-bits", cl::Hidden, cl::init(14), cl::desc("Restrict range of TB[N]Z instructions (DEBUG)")) |
| static cl::opt< unsigned > | CBZDisplacementBits ("aarch64-cbz-offset-bits", cl::Hidden, cl::init(19), cl::desc("Restrict range of CB[N]Z instructions (DEBUG)")) |
| static cl::opt< unsigned > | BCCDisplacementBits ("aarch64-bcc-offset-bits", cl::Hidden, cl::init(19), cl::desc("Restrict range of Bcc instructions (DEBUG)")) |
| static cl::opt< unsigned > | BDisplacementBits ("aarch64-b-offset-bits", cl::Hidden, cl::init(26), cl::desc("Restrict range of B instructions (DEBUG)")) |
| static cl::opt< unsigned > | GatherOptSearchLimit ("aarch64-search-limit", cl::Hidden, cl::init(2048), cl::desc("Restrict range of instructions to search for the " "machine-combiner gather pattern optimization")) |
| static cl::opt< bool > | UseCompactUnwindFrameRecordForOutlinedFunctions ("aarch64-outliner-compact-unwind-frame", cl::Hidden, cl::init(true), cl::desc("Use a frame record for Mach-O non-leaf outlined functions")) |
| #define DEBUG_TYPE "AArch64InstrInfo" |
Definition at line 71 of file AArch64InstrInfo.cpp.
| #define GET_INSTRINFO_CTOR_DTOR |
Definition at line 68 of file AArch64InstrInfo.cpp.
| #define GET_INSTRINFO_HELPERS |
Definition at line 12344 of file AArch64InstrInfo.cpp.
| #define GET_INSTRMAP_INFO |
Definition at line 12345 of file AArch64InstrInfo.cpp.
| enum AccessKind |
| Enumerator | |
|---|---|
| AK_Write | |
| AK_Read | |
| AK_All | |
Definition at line 1814 of file AArch64InstrInfo.cpp.
|
strong |
| Enumerator | |
|---|---|
| Default | |
| Indexed | |
| Accumulator | |
Definition at line 8724 of file AArch64InstrInfo.cpp.
| enum MachineOutlinerClass |
Constants defining how certain sequences should be outlined.
This encompasses how an outlined function should be called, and what kind of frame should be emitted for that outlined function.
MachineOutlinerDefault implies that the function should be called with a save and restore of LR to the stack.
That is,
I1 Save LR OUTLINED_FUNCTION: I2 --> BL OUTLINED_FUNCTION I1 I3 Restore LR I2 I3 RET
MachineOutlinerTailCall implies that the function is being created from a sequence of instructions ending in a return.
That is,
I1 OUTLINED_FUNCTION: I2 --> B OUTLINED_FUNCTION I1 RET I2 RET
MachineOutlinerNoLRSave implies that the function should be called using a BL instruction, but doesn't require LR to be saved and restored. This happens when LR is known to be dead.
That is,
I1 OUTLINED_FUNCTION: I2 --> BL OUTLINED_FUNCTION I1 I3 I2 I3 RET
MachineOutlinerThunk implies that the function is being created from a sequence of instructions ending in a call. The outlined function is called with a BL instruction, and the outlined function tail-calls the original call destination.
That is,
I1 OUTLINED_FUNCTION: I2 --> BL OUTLINED_FUNCTION I1 BL f I2 B f
MachineOutlinerRegSave implies that the function should be called with a save and restore of LR to an available register. This allows us to avoid stack fixups. Note that this outlining variant is compatible with the NoLRSave case.
That is,
I1 Save LR OUTLINED_FUNCTION: I2 --> BL OUTLINED_FUNCTION I1 I3 Restore LR I2 I3 RET
Definition at line 10315 of file AArch64InstrInfo.cpp.
| Enumerator | |
|---|---|
| LRUnavailableSomewhere | |
| HasCalls | |
| UnsafeRegsDead | |
Definition at line 10323 of file AArch64InstrInfo.cpp.
|
static |
Definition at line 5734 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), Reg, and TRI.
Referenced by llvm::AArch64InstrInfo::copyGPRRegTuple(), and llvm::AArch64InstrInfo::copyPhysRegTuple().
|
static |
Definition at line 6781 of file AArch64InstrInfo.cpp.
References llvm::appendLEB128(), Operation, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by appendLoadRegExpr(), llvm::createCFAOffset(), and createDefCFAExpression().
|
static |
Definition at line 6807 of file AArch64InstrInfo.cpp.
References appendConstantExpr(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::createCFAOffset().
|
static |
Definition at line 6819 of file AArch64InstrInfo.cpp.
Referenced by llvm::createCFAOffset(), and createDefCFAExpression().
|
static |
Definition at line 6799 of file AArch64InstrInfo.cpp.
References llvm::appendLEB128(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::createCFAOffset(), and createDefCFAExpression().
|
static |
True when condition flags are accessed (either by writing or reading) on the instruction trace starting at From and ending at To.
Note: If From and To are from different blocks it's assumed CC are accessed on the path.
Definition at line 1821 of file AArch64InstrInfo.cpp.
References AK_All, AK_Read, AK_Write, assert(), llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse(), llvm::instructionsWithoutDebug(), MI, and TRI.
Referenced by canCmpInstrBeRemoved(), canInstrSubstituteCmpInstr(), and llvm::AArch64InstrInfo::optimizeCondBranch().
|
static |
Check if AArch64::NZCV should be alive in successors of MBB.
Definition at line 2201 of file AArch64InstrInfo.cpp.
References MBB.
Referenced by llvm::examineCFlagsUse().
|
static |
CmpInstr can be removed.IsInvertCC is true if, after removing CmpInstr, condition codes used in CCUseInstrs must be inverted.
Definition at line 2434 of file AArch64InstrInfo.cpp.
References AK_Write, areCFlagsAccessedBetweenInstrs(), assert(), llvm::UsedNZCV::C, llvm::AArch64CC::EQ, llvm::examineCFlagsUse(), findCondCodeUsedByInstr(), llvm::MachineInstr::getOpcode(), getUsedNZCV(), llvm::AArch64CC::Invalid, isADDSRegImm(), isSUBSRegImm(), MI, llvm::UsedNZCV::N, llvm::AArch64CC::NE, llvm::AArch64CC::PL, TRI, llvm::UsedNZCV::V, and llvm::UsedNZCV::Z.
|
static |
Definition at line 7572 of file AArch64InstrInfo.cpp.
References assert(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::MachineRegisterInfo::hasOneNonDBGUse(), isCombineInstrSettingFlag(), llvm::MachineOperand::isReg(), llvm::Register::isVirtual(), MBB, and MI.
|
static |
Definition at line 7612 of file AArch64InstrInfo.cpp.
References canCombine(), and MBB.
Referenced by getFMAPatterns().
|
static |
Definition at line 7605 of file AArch64InstrInfo.cpp.
References canCombine(), and MBB.
Referenced by getMaddPatterns().
|
static |
Definition at line 929 of file AArch64InstrInfo.cpp.
References assert(), DefMI, llvm::MachineRegisterInfo::getRegClass(), llvm::MachineRegisterInfo::getVRegDef(), llvm::Register::isVirtualRegister(), Opc, and removeCopies().
Referenced by llvm::AArch64InstrInfo::canInsertSelect(), and llvm::AArch64InstrInfo::insertSelect().
|
static |
Check if CmpInstr can be substituted by MI.
CmpInstr can be substituted:
Definition at line 2368 of file AArch64InstrInfo.cpp.
References AK_All, AK_Write, areCFlagsAccessedBetweenInstrs(), assert(), llvm::examineCFlagsUse(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), isADDSRegImm(), isANDOpcode(), llvm::MachineOperand::isImm(), isSUBSRegImm(), MI, llvm::MachineInstr::NoSWrap, sForm(), and TRI.
Definition at line 5591 of file AArch64InstrInfo.cpp.
Referenced by llvm::AArch64InstrInfo::shouldClusterMemOps().
|
static |
Clone an instruction from MI.
The register of ReplaceOprNum-th operand is replaced by ReplaceReg. The output register is newly created. The other operands are unchanged from MI.
Definition at line 11942 of file AArch64InstrInfo.cpp.
References llvm::MachineRegisterInfo::constrainRegClass(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineInstr::getDesc(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), I, llvm::Register::isVirtual(), MBB, MI, llvm::MachineOperand::setReg(), and TII.
|
static |
Return the opcode that does not set flags when possible - otherwise return the original opcode.
The caller is responsible to do the actual substitution and legality checking.
Definition at line 1768 of file AArch64InstrInfo.cpp.
References MI.
Referenced by getMaddPatterns(), and llvm::AArch64InstrInfo::optimizeCompareInstr().
|
static |
Definition at line 6830 of file AArch64InstrInfo.cpp.
References llvm::SmallString< InternalLen >::append(), appendConstantExpr(), llvm::appendLEB128(), appendOffsetComment(), appendReadRegExpr(), assert(), llvm::MCCFIInstruction::createEscape(), llvm::Offset, llvm::printReg(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), Reg, llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::SmallString< InternalLen >::str(), and TRI.
Referenced by llvm::createDefCFA(), and llvm::RISCVFrameLowering::emitPrologue().
|
static |
If the given ORR instruction is a copy, and DescribedReg overlaps with the destination register then, if possible, describe the value in terms of the source register.
Definition at line 11577 of file AArch64InstrInfo.cpp.
References assert(), llvm::MachineOperand::CreateReg(), llvm::MDNode::get(), llvm::Register::isValid(), MI, TII, and TRI.
|
static |
Definition at line 6938 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::createDefCFA(), DL, llvm::StackOffset::getFixed(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::StackOffset::getScalable(), llvm::AArch64_AM::getShifterImm(), llvm::MachineFunction::getSubtarget(), Imm, llvm_unreachable, llvm::AArch64_AM::LSL, MBB, MBBI, llvm::Offset, Opc, llvm::MachineInstrBuilder::setMIFlag(), llvm::MachineInstrBuilder::setMIFlags(), TII, TRI, and uint64_t.
Referenced by llvm::emitFrameOffset().
|
static |
Definition at line 12067 of file AArch64InstrInfo.cpp.
Referenced by getIndVarInfo().
|
static |
Find a condition code used by the instruction.
Returns AArch64CC::Invalid if either the instruction does not use condition codes or we don't optimize CmpInstr in the presence of such instructions.
Definition at line 2242 of file AArch64InstrInfo.cpp.
References llvm::getImm(), and llvm::AArch64CC::Invalid.
Referenced by canCmpInstrBeRemoved(), and llvm::examineCFlagsUse().
Definition at line 5746 of file AArch64InstrInfo.cpp.
Referenced by llvm::AArch64InstrInfo::copyPhysRegTuple(), and llvm::RISCVInstrInfo::copyPhysRegVector().
|
static |
Generate optimized instruction sequence for gather load patterns to improve Memory-Level Parallelism (MLP).
This function transforms a chain of sequential NEON lane loads into parallel vector loads that can execute concurrently.
Definition at line 8514 of file AArch64InstrInfo.cpp.
References A(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), B(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::enumerate(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::getKillRegState(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::MachineOperand::isKill(), llvm_unreachable, llvm::make_range(), llvm::MachineInstr::memoperands(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reverse(), llvm::MachineInstrBuilder::setMemRefs(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::sort(), and TII.
|
static |
Definition at line 8806 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::getKillRegState(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::MachineOperand::isKill(), llvm::Register::isVirtual(), Opc, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TII.
|
static |
genFusedMultiply - Generate fused multiply instructions.
This function supports both integer and floating point instructions. A typical example: F|MUL I=A,B,0 F|ADD R,I,C ==> F|MADD R,A,B,C
| MF | Containing MachineFunction | |
| MRI | Register information | |
| TII | Target information | |
| Root | is the F|ADD instruction | |
| [out] | InsInstrs | is a vector of machine instructions and will contain the generated madd instruction |
| IdxMulOpd | is index of operand in Root that is the result of the F|MUL. In the example above IdxMulOpd is 1. | |
| MaddOpc | the opcode fo the f|madd instruction | |
| RC | Register class of operands | |
| kind | of fma instruction (addressing mode) to be generated | |
| ReplacedAddend | is the result register from the instruction replacing the non-combined operand, if any. |
Definition at line 8745 of file AArch64InstrInfo.cpp.
References Accumulator, llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), Default, llvm::getKillRegState(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getUniqueVRegDef(), Indexed, llvm::MachineOperand::isKill(), llvm::Register::isVirtual(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TII.
Referenced by genFusedMultiplyAcc(), genFusedMultiplyAccNeg(), genFusedMultiplyIdx(), and genFusedMultiplyIdxNeg().
|
static |
genFusedMultiplyAcc - Helper to generate fused multiply accumulate instructions.
Definition at line 8889 of file AArch64InstrInfo.cpp.
References Accumulator, genFusedMultiply(), and TII.
|
static |
genFusedMultiplyAccNeg - Helper to generate fused multiply accumulate instructions with an additional negation of the accumulator
Definition at line 8918 of file AArch64InstrInfo.cpp.
References Accumulator, assert(), genFusedMultiply(), genNeg(), and TII.
|
static |
genFusedMultiplyIdx - Helper to generate fused multiply accumulate instructions.
Definition at line 8935 of file AArch64InstrInfo.cpp.
References genFusedMultiply(), Indexed, and TII.
|
static |
genFusedMultiplyAccNeg - Helper to generate fused multiply accumulate instructions with an additional negation of the accumulator
Definition at line 8945 of file AArch64InstrInfo.cpp.
References assert(), genFusedMultiply(), genNeg(), Indexed, and TII.
|
static |
Fold (FMUL x (DUP y lane)) into (FMUL_indexed x y lane)
Definition at line 8848 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::clearKillFlags(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::MachineOperand::getImm(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineInstr::getMF(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TII.
|
static |
genMaddR - Generate madd instruction and combine mul and add using an extra virtual register Example - an ADD intermediate needs to be stored in a register: MUL I=A,B,0 ADD R,I,Imm ==> ORR V, ZR, Imm ==> MADD R,A,B,V
| MF | Containing MachineFunction | |
| MRI | Register information | |
| TII | Target information | |
| Root | is the ADD instruction | |
| [out] | InsInstrs | is a vector of machine instructions and will contain the generated madd instruction |
| IdxMulOpd | is index of operand in Root that is the result of the MUL. In the example above IdxMulOpd is 1. | |
| MaddOpc | the opcode fo the madd instruction | |
| VR | is a virtual register that holds the value of an ADD operand (V in the example above). | |
| RC | Register class of operands |
Definition at line 8978 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::getKillRegState(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::Register::isVirtual(), llvm::Register::isVirtualRegister(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TII.
|
static |
genNeg - Helper to generate an intermediate negation of the second operand of Root
Definition at line 8899 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::MachineInstr::getOperand(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TII.
Referenced by genFusedMultiplyAccNeg(), and genFusedMultiplyIdxNeg().
|
static |
Do the following transformation A - (B + C) ==> (A - B) - C A - (B + C) ==> (A - C) - B.
Definition at line 9014 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::getKillRegState(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::MachineOperand::isKill(), llvm::MachineInstr::mergeFlagsWith(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineInstrBuilder::setMIFlags(), and TII.
Definition at line 384 of file AArch64InstrInfo.cpp.
References BCCDisplacementBits, BDisplacementBits, CBDisplacementBits, CBZDisplacementBits, llvm_unreachable, Opc, and TBZDisplacementBits.
Referenced by llvm::AArch64InstrInfo::isBranchOffsetInRange().
|
static |
Floating-Point Support.
Find instructions that can be turned into madd.
Definition at line 7994 of file AArch64InstrInfo.cpp.
References assert(), canCombineWithFMUL(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), isCombineInstrCandidateFP(), llvm::MachineOperand::isReg(), MBB, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Definition at line 8136 of file AArch64InstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::MachineOperand::isReg(), llvm::Register::isVirtual(), MBB, MI, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Definition at line 8188 of file AArch64InstrInfo.cpp.
References llvm::MachineInstr::FmContract, llvm::MachineInstr::FmNsz, llvm::FNMADD, llvm::MachineInstr::getFlag(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::MachineRegisterInfo::hasOneNonDBGUse(), MBB, MI, Opc, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Check if the given instruction forms a gather load pattern that can be optimized for better Memory-Level Parallelism (MLP).
This function identifies chains of NEON lane load instructions that load data from different memory addresses into individual lanes of a 128-bit vector register, then attempts to split the pattern into parallel loads to break the serial dependency between instructions.
Pattern Matched: Initial scalar load -> SUBREG_TO_REG (lane 0) -> LD1i* (lane 1) -> LD1i* (lane 2) -> ... -> LD1i* (lane N-1, Root)
Transformed Into: Two parallel vector loads using fewer lanes each, followed by ZIP1v2i64 to combine the results, enabling better memory-level parallelism.
Supported Element Types:
Definition at line 8392 of file AArch64InstrInfo.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallPtrSetImplBase::empty(), llvm::SmallSet< T, N, C >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallPtrSetImpl< PtrType >::erase(), llvm::SmallSet< T, N, C >::erase(), llvm::GATHER_LANE_i16, llvm::GATHER_LANE_i32, llvm::GATHER_LANE_i8, GatherOptSearchLimit, llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getMF(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::Function::hasMinSize(), llvm::MachineRegisterInfo::hasOneNonDBGUse(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineInstr::isLoadFoldBarrier(), llvm_unreachable, MBB, llvm::SmallVectorTemplateBase< T, bool >::push_back(), Range, llvm::seq(), and TRI.
Referenced by getLoadPatterns().
|
static |
If Reg is an induction variable, return true and set some parameters.
Definition at line 12088 of file AArch64InstrInfo.cpp.
References extractPhiReg(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineRegisterInfo::getVRegDef(), isDefinedOutside(), llvm::Register::isVirtual(), llvm::MachineBasicBlock::pred_size(), and Reg.
Referenced by llvm::AArch64InstrInfo::analyzeLoopForPipelining().
|
static |
Return the maximum number of bytes of code the specified instruction may be after LFI rewriting.
If the instruction is not rewritten, std::nullopt is returned (use default sizing).
NOTE: the size estimates here must be kept in sync with the rewrites in AArch64MCLFIRewriter.cpp. Sizes may be overestimates of the rewritten instruction sequences.
Definition at line 123 of file AArch64InstrInfo.cpp.
References llvm::isLFIPrePostMemAccess(), MI, and Size.
Referenced by llvm::AArch64InstrInfo::getInstSizeInBytes().
|
static |
Search for patterns of LD instructions we can optimize.
Definition at line 8493 of file AArch64InstrInfo.cpp.
References getGatherLanePattern(), and llvm::MachineInstr::getOpcode().
|
static |
Find instructions that can be turned into madd.
Definition at line 7725 of file AArch64InstrInfo.cpp.
References assert(), canCombine(), canCombineWithMUL(), convertToNonFlagSettingOpc(), llvm::MachineInstr::findRegisterDefOperandIdx(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), isCombineInstrCandidate(), isCombineInstrSettingFlag(), llvm::MachineOperand::isReg(), MBB, Opc, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Find other MI combine patterns.
Definition at line 8339 of file AArch64InstrInfo.cpp.
References canCombine(), llvm::MachineInstr::findRegisterDefOperandIdx(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), isCombineInstrSettingFlag(), MBB, Opc, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SUBADD_OP1, and llvm::SUBADD_OP2.
|
static |
Definition at line 5483 of file AArch64InstrInfo.cpp.
References llvm::MachineRegisterInfo::getRegClassOrNull(), llvm::MachineFunction::getRegInfo(), MI, and Reg.
Referenced by llvm::SIInstrInfo::expandPostRAPseudo(), llvm::SIInstrInfo::foldImmediate(), llvm::AArch64InstrInfo::foldMemoryOperandImpl(), llvm::HexagonRegisterInfo::getHexagonSubRegIndex(), llvm::ARMBaseRegisterInfo::getLargestLegalSuperClass(), llvm::PPCRegisterInfo::getLargestLegalSuperClass(), llvm::X86RegisterInfo::getLargestLegalSuperClass(), llvm::M68kRegisterInfo::getSpillRegisterOrder(), llvm::AArch64InstrInfo::isFpOrNEON(), llvm::AArch64InstrInfo::isHForm(), llvm::AArch64InstrInfo::isQForm(), llvm::SIRegisterInfo::isSGPRClassID(), llvm::SIInstrInfo::legalizeOperandsFLAT(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::SIInstrInfo::reMaterialize(), selectCopy(), and llvm::AVRRegisterInfo::shouldCoalesce().
|
static |
Definition at line 2250 of file AArch64InstrInfo.cpp.
References assert(), llvm::UsedNZCV::C, llvm::AArch64CC::EQ, llvm::AArch64CC::GE, llvm::AArch64CC::GT, llvm::AArch64CC::HI, llvm::AArch64CC::HS, llvm::AArch64CC::Invalid, llvm::AArch64CC::LE, llvm::AArch64CC::LO, llvm::AArch64CC::LS, llvm::AArch64CC::LT, llvm::AArch64CC::MI, llvm::UsedNZCV::N, llvm::AArch64CC::NE, llvm::AArch64CC::PL, llvm::UsedNZCV::V, llvm::AArch64CC::VC, llvm::AArch64CC::VS, and llvm::UsedNZCV::Z.
Referenced by canCmpInstrBeRemoved(), and llvm::examineCFlagsUse().
Definition at line 2327 of file AArch64InstrInfo.cpp.
Referenced by canCmpInstrBeRemoved(), and canInstrSubstituteCmpInstr().
|
static |
Definition at line 2335 of file AArch64InstrInfo.cpp.
References MI, Opc, and sForm().
Referenced by canInstrSubstituteCmpInstr().
|
static |
Definition at line 1352 of file AArch64InstrInfo.cpp.
References assert(), llvm::MachineRegisterInfo::getRegClass(), MI, and Reg.
Referenced by llvm::AArch64InstrInfo::isAsCheapAsAMove().
|
static |
Definition at line 1339 of file AArch64InstrInfo.cpp.
References assert(), llvm::AArch64_IMM::expandMOVImm(), llvm::getImm(), Imm, MI, llvm::SmallVectorTemplateCommon< T, typename >::size(), and uint64_t.
Referenced by llvm::AArch64InstrInfo::isAsCheapAsAMove().
Definition at line 7565 of file AArch64InstrInfo.cpp.
References isCombineInstrCandidate32(), isCombineInstrCandidate64(), and Opc.
Referenced by getMaddPatterns().
Definition at line 7485 of file AArch64InstrInfo.cpp.
References Opc.
Referenced by isCombineInstrCandidate().
Definition at line 7504 of file AArch64InstrInfo.cpp.
References Opc.
Referenced by isCombineInstrCandidate().
|
static |
Definition at line 7535 of file AArch64InstrInfo.cpp.
References llvm::FPOpFusion::Fast, llvm::MachineInstr::FmContract, llvm::MachineInstr::getFlag(), llvm::MachineInstr::getOpcode(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineFunction::getTarget(), llvm::TargetMachine::Options, and Options.
Referenced by getFMAPatterns().
Definition at line 7466 of file AArch64InstrInfo.cpp.
References Opc.
Referenced by canCombine(), getMaddPatterns(), and getMiscPatterns().
|
static |
Return true if the frame-record form of the outlined prologue is enabled for the target of MF.
A non-leaf outlined function must save LR. On MachO, saving LR alone (str x30) has no compact unwind encoding, so we get a large DWARF FDE instead. Saving FP and LR as a frame record (stp x29, x30 ; mov x29, sp) gets the small FRAME encoding, and costs one extra instruction.
Definition at line 10336 of file AArch64InstrInfo.cpp.
References llvm::MachineFunction::getTarget(), llvm::TargetMachine::getTargetTriple(), llvm::Triple::isOSBinFormatMachO(), and UseCompactUnwindFrameRecordForOutlinedFunctions.
Referenced by predictCompactUnwindFrameRecordForOutlinedFunction(), and shouldUseCompactUnwindFrameRecordForOutlinedFunction().
|
static |
Definition at line 12080 of file AArch64InstrInfo.cpp.
References llvm::MachineRegisterInfo::getDefBlock(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), and Reg.
Referenced by llvm::AArch64InstrInfo::analyzeLoopForPipelining(), and getIndVarInfo().
|
static |
Definition at line 2833 of file AArch64InstrInfo.cpp.
Referenced by llvm::AArch64InstrInfo::isLoadFromStackSlot(), llvm::X86InstrInfo::isLoadFromStackSlot(), llvm::AArch64InstrInfo::isLoadFromStackSlotPostFE(), and llvm::X86InstrInfo::isLoadFromStackSlotPostFE().
|
static |
Definition at line 2862 of file AArch64InstrInfo.cpp.
Referenced by llvm::AArch64InstrInfo::isStoreToStackSlot(), llvm::X86InstrInfo::isStoreToStackSlot(), llvm::AArch64InstrInfo::isStoreToStackSlotPostFE(), and llvm::X86InstrInfo::isStoreToStackSlotPostFE().
|
static |
Returns true if the instruction at I is in a streaming call site region, within a single basic block.
A "call site streaming region" starts after smstart and ends at smstop around a call to a streaming function. This walks backward from I.
Definition at line 5809 of file AArch64InstrInfo.cpp.
References llvm::MachineFunction::getInfo(), llvm::AArch64FunctionInfo::hasStreamingModeChanges(), I, llvm::make_range(), MBB, MI, Opc, and llvm::reverse().
Referenced by mustAvoidNeonAtMBBI().
Return true if the opcode is a post-index ld/st instruction, which really loads from base+0.
Definition at line 4420 of file AArch64InstrInfo.cpp.
Referenced by llvm::AArch64InstrInfo::getMemOperandWithOffsetWidth().
Definition at line 2331 of file AArch64InstrInfo.cpp.
Referenced by canCmpInstrBeRemoved(), and canInstrSubstituteCmpInstr().
|
static |
Definition at line 6544 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::dwarf_linker::DebugLoc, llvm::Define, llvm::getUndefRegState(), llvm::Register::isPhysical(), MBB, and TRI.
Referenced by llvm::AArch64InstrInfo::loadRegFromStackSlot().
|
static |
Returns true if in a streaming call site region without SME-FA64.
Definition at line 5831 of file AArch64InstrInfo.cpp.
References I, isInStreamingCallSiteRegion(), and MBB.
Referenced by llvm::AArch64InstrInfo::copyPhysReg().
Definition at line 4249 of file AArch64InstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::AArch64InstrInfo::emitLdStWithAddr().
|
static |
Definition at line 10413 of file AArch64InstrInfo.cpp.
References llvm::MachineFunction::getInfo(), llvm::outliner::Candidate::getMF(), and llvm::AArch64FunctionInfo::shouldSignWithBKey().
|
static |
Definition at line 10403 of file AArch64InstrInfo.cpp.
References llvm::MachineFunction::getInfo(), llvm::outliner::Candidate::getMF(), and llvm::AArch64FunctionInfo::getSignReturnAddressCondition().
|
static |
Definition at line 10421 of file AArch64InstrInfo.cpp.
References llvm::outliner::Candidate::getMF(), and llvm::MachineFunction::getSubtarget().
|
static |
Definition at line 330 of file AArch64InstrInfo.cpp.
References Cond, llvm::MachineOperand::CreateImm(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), and llvm_unreachable.
Referenced by llvm::AArch64InstrInfo::analyzeBranch(), llvm::CSKYInstrInfo::analyzeBranch(), llvm::LoongArchInstrInfo::analyzeBranch(), llvm::RISCVInstrInfo::analyzeBranch(), llvm::SparcInstrInfo::analyzeBranch(), and llvm::VEInstrInfo::analyzeBranch().
|
static |
Predict what the above will answer, for use while costing candidates.
The outlined function does not exist yet, so answer from RepeatedSequenceLocs instead. This is only an estimate; buildOutlinedFrame() makes the call.
Definition at line 10362 of file AArch64InstrInfo.cpp.
References llvm::all_of(), C(), llvm::MachineFunction::getInfo(), isCompactUnwindFrameRecordEnabled(), llvm::none_of(), and TRI.
Definition at line 3994 of file AArch64InstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::AArch64InstrInfo::emitLdStWithAddr().
|
static |
Definition at line 916 of file AArch64InstrInfo.cpp.
References DefMI, llvm::MachineRegisterInfo::getVRegDef(), and llvm::Register::isVirtualRegister().
Referenced by canFoldIntoCSel().
Definition at line 4068 of file AArch64InstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::AArch64InstrInfo::emitLdStWithAddr().
Definition at line 5577 of file AArch64InstrInfo.cpp.
References llvm::AArch64InstrInfo::getMemScale(), llvm::Offset, and Opc.
Referenced by llvm::AArch64InstrInfo::shouldClusterMemOps().
|
static |
Get opcode of S version of Instr.
If Instr is S version its opcode is returned. AArch64::INSTRUCTION_LIST_END is returned if Instr does not have S version or we are not interested in it.
Definition at line 2100 of file AArch64InstrInfo.cpp.
Referenced by canInstrSubstituteCmpInstr(), and isANDOpcode().
|
static |
Definition at line 5636 of file AArch64InstrInfo.cpp.
References assert(), llvm::AArch64InstrInfo::getMemScale(), llvm::MachineFrameInfo::getObjectOffset(), and llvm::MachineFrameInfo::isFixedObjectIndex().
Referenced by llvm::AArch64InstrInfo::shouldClusterMemOps().
|
static |
Return true if the outlined function in MBB should save FP and LR as a frame record instead of saving LR alone.
Definition at line 10343 of file AArch64InstrInfo.cpp.
References llvm::LiveRegUnits::accumulate(), llvm::LiveRegUnits::available(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), isCompactUnwindFrameRecordEnabled(), MBB, MI, and llvm::AArch64FunctionInfo::needsDwarfUnwindInfo().
|
static |
Definition at line 11215 of file AArch64InstrInfo.cpp.
References llvm::BuildMI(), llvm::dwarf_linker::DebugLoc, llvm::MachineInstr::FrameSetup, MBB, llvm::MachineInstrBuilder::setMIFlag(), and TII.
| STATISTIC | ( | NumCopyInstrs | , |
| "Number of COPY instructions expanded" | ) |
| STATISTIC | ( | NumZCRegMoveInstrsFPR | , |
| "Number of zero-cycle FPR register move " "instructions expanded from canonical COPY" | ) |
| STATISTIC | ( | NumZCRegMoveInstrsGPR | , |
| "Number of zero-cycle GPR register move " "instructions expanded from canonical COPY" | ) |
| STATISTIC | ( | NumZCZeroingInstrsGPR | , |
| "Number of zero-cycle GPR zeroing " "instructions expanded from canonical COPY" | ) |
|
static |
Definition at line 6366 of file AArch64InstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::dwarf_linker::DebugLoc, llvm::getKillRegState(), llvm::Register::isPhysical(), MBB, and TRI.
Referenced by llvm::AArch64InstrInfo::storeRegToStackSlot().
Definition at line 4173 of file AArch64InstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::AArch64InstrInfo::emitLdStWithAddr().
|
static |
Definition at line 1727 of file AArch64InstrInfo.cpp.
References assert(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::MCRegisterClass::contains(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::MCRegisterClass::hasSubClassEq(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isReg(), MBB, Reg, TII, and TRI.
Referenced by llvm::AArch64InstrInfo::optimizeCompareInstr().
|
static |
Referenced by getBranchDisplacementBits().
|
static |
Referenced by getBranchDisplacementBits().
|
static |
Referenced by getBranchDisplacementBits().
|
static |
Referenced by getBranchDisplacementBits().
|
static |
Referenced by getGatherLanePattern().
|
static |
Referenced by getBranchDisplacementBits().
|
static |
Referenced by isCompactUnwindFrameRecordEnabled().