LLVM  14.0.0git
Macros | Functions | Variables
AArch64MIPeepholeOpt.cpp File Reference
#include "AArch64ExpandImm.h"
#include "AArch64InstrInfo.h"
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
Include dependency graph for AArch64MIPeepholeOpt.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "aarch64-mi-peephole-opt"
 

Functions

 INITIALIZE_PASS (AArch64MIPeepholeOpt, "aarch64-mi-peephole-opt", "AArch64 MI Peephole Optimization", false, false) template< typename T > static bool splitBitmaskImm(T Imm
 
 if (AArch64_AM::isLogicalImmediate(UImm, RegSize)) return false
 
 if (Insn.size()==1) return false
 
 if (!AArch64_AM::isLogicalImmediate(NewImm2, RegSize)) return false
 

Variables

unsigned RegSize
 
unsigned TImm1Enc = AArch64_AM::encodeLogicalImmediate(NewImm1, RegSize)
 
unsigned T TImm2Enc
 
SmallVector< AArch64_IMM::ImmInsnModel, 4 > Insn
 
unsigned LowestBitSet = countTrailingZeros(UImm)
 
unsigned HighestBitSet = Log2_64(UImm)
 
T NewImm1
 
T NewImm2 = UImm | ~NewImm1
 
return true
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "aarch64-mi-peephole-opt"

Definition at line 39 of file AArch64MIPeepholeOpt.cpp.

Function Documentation

◆ if() [1/3]

if ( AArch64_AM::isLogicalImmediateNewImm2, RegSize)

◆ if() [2/3]

if ( AArch64_AM::isLogicalImmediate(UImm, RegSize )

◆ if() [3/3]

if ( Insn.  size() = =1)

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( AArch64MIPeepholeOpt  ,
"aarch64-mi-peephole-opt ,
"AArch64 MI Peephole Optimization ,
false  ,
false   
)

Variable Documentation

◆ HighestBitSet

unsigned HighestBitSet = Log2_64(UImm)

Definition at line 97 of file AArch64MIPeepholeOpt.cpp.

◆ Imm1Enc

Imm1Enc = AArch64_AM::encodeLogicalImmediate(NewImm1, RegSize)

Definition at line 80 of file AArch64MIPeepholeOpt.cpp.

◆ Imm2Enc

Imm2Enc
Initial value:
{
T UImm = static_cast<T>(Imm)

Definition at line 80 of file AArch64MIPeepholeOpt.cpp.

◆ Insn

Definition at line 86 of file AArch64MIPeepholeOpt.cpp.

Referenced by checkDecodedInstruction(), Decode2OpInstruction(), Decode2OpInstructionFail(), Decode2RImmInstruction(), Decode2RInstruction(), Decode2RSrcDstInstruction(), Decode2RUSBitpInstruction(), Decode2RUSInstruction(), Decode3OpInstruction(), Decode3RImmInstruction(), Decode3RInstruction(), DecodeAddrMode2IdxInstruction(), DecodeAddrMode3Instruction(), decodeAField(), DecodeANDI16Imm(), DecodeArmMOVTWInstruction(), decodeBField(), decodeBranch(), DecodeBranchImmInstruction(), DecodeCacheeOp_CacheOpR6(), DecodeCacheOp(), DecodeCacheOpMM(), DecodeCCRU6Instruction(), decodeCField(), DecodeCopMemInstruction(), DecodeCPSInstruction(), DecodeCRC(), DecodeDEXT(), DecodeDINS(), DecodeDoubleRegLoad(), DecodeDoubleRegStore(), DecodeDstAddrMode(), decodeFFMULRdRr(), decodeFIOARr(), decodeFIOBIT(), decodeFIORdA(), decodeFLPMX(), DecodeFMem(), DecodeFMem2(), DecodeFMem3(), DecodeFMemCop2MMR6(), DecodeFMemCop2R6(), DecodeFMemMMR2(), DecodeFMOVLaneInstruction(), decodeFMOVWRdRr(), decodeFMUL2RdRr(), decodeFRd(), decodeFWRdK(), DecodeHINTInstruction(), DecodeInsSize(), DecodeIT(), DecodeJumpTarget(), DecodeJumpTargetMM(), DecodeJumpTargetXMM(), DecodeL2OpInstructionFail(), DecodeL2RInstruction(), DecodeL2RUSBitpInstruction(), DecodeL2RUSInstruction(), DecodeL3RInstruction(), DecodeL3RSrcDstInstruction(), DecodeL4RSrcDstInstruction(), DecodeL4RSrcDstSrcDstInstruction(), DecodeL5RInstruction(), DecodeL5RInstructionFail(), DecodeL6RInstruction(), DecodeLdLImmInstruction(), DecodeLdRLImmInstruction(), DecodeLDRPreImm(), DecodeLDRPreReg(), DecodeLoadByte15(), DecodeLOLoop(), DecodeLR2RInstruction(), DecodeMem(), DecodeMemEVA(), DecodeMemMMGPImm7Lsl2(), DecodeMemMMImm12(), DecodeMemMMImm16(), DecodeMemMMImm4(), DecodeMemMMImm9(), DecodeMemMMReglistImm4Lsl2(), DecodeMemMMSPImm5Lsl2(), DecodeMemMultipleWritebackInstruction(), decodeMemoryOpValue(), DecodeMEMrs9(), DecodeMoveHRegInstruction(), DecodeMovePOperands(), DecodeMSA128Mem(), DecodeMveAddrModeQ(), DecodeMveAddrModeRQ(), DecodeMVEModImmInstruction(), DecodeMVEOverlappingLongShift(), DecodeMVEVADCInstruction(), DecodeMVEVCMP(), DecodeMveVCTP(), DecodeMVEVCVTt1fp(), DecodeMVEVMOVDRegtoQ(), DecodeMVEVMOVQtoDReg(), DecodeNEONComplexLane64Instruction(), DecodePostIdxReg(), DecodePrefeOpMM(), DecodeQADDInstruction(), DecodeR2RInstruction(), DecodeRegListOperand(), DecodeRegListOperand16(), DecodeRFEInstruction(), decodeRiMemoryValue(), decodeRrMemoryValue(), DecodeRUSBitpInstruction(), DecodeRUSInstruction(), DecodeRUSSrcDstBitpInstruction(), decodeRVCInstrRdRs1Rs2(), decodeRVCInstrRdRs1UImm(), decodeRVCInstrRdRs2(), decodeRVCInstrRdSImm(), decodeRVCInstrSImm(), DecodeSETPANInstruction(), decodeShiftImm(), DecodeSimm18Lsl3(), DecodeSimm19Lsl2(), DecodeSimm23Lsl2(), DecodeSimm9SP(), DecodeSMLAInstruction(), DecodeSOPwithRS12(), DecodeSOPwithRU6(), DecodeSpecial3LlSc(), decodeSplsValue(), DecodeSrcAddrModeI(), DecodeSrcAddrModeII(), DecodeStLImmInstruction(), DecodeSTRPreImm(), DecodeSTRPreReg(), DecodeSwap(), DecodeSyncI(), DecodeSyncI_MM(), DecodeSynciR6(), DecodeT2AddSubSPImm(), DecodeT2Adr(), DecodeT2BInstruction(), DecodeT2CPSInstruction(), DecodeT2HintSpaceInstruction(), DecodeT2LDRDPreInstruction(), DecodeT2LdStPre(), DecodeT2LoadImm12(), DecodeT2LoadImm8(), DecodeT2LoadLabel(), DecodeT2LoadShift(), DecodeT2LoadT(), DecodeT2MOVTWInstruction(), DecodeT2STRDPreInstruction(), DecodeTBLInstruction(), DecodeThumb2BCCInstruction(), DecodeThumbAddSpecialReg(), DecodeThumbAddSPImm(), DecodeThumbAddSPReg(), DecodeThumbCPS(), DecodeThumbTableBranch(), DecodeTSTInstruction(), DecodeVCVTD(), DecodeVCVTQ(), DecodeVLD1DupInstruction(), DecodeVLD1LN(), DecodeVLD2DupInstruction(), DecodeVLD2LN(), DecodeVLD3DupInstruction(), DecodeVLD3LN(), DecodeVLD4DupInstruction(), DecodeVLD4LN(), DecodeVLDInstruction(), DecodeVLDST1Instruction(), DecodeVLDST2Instruction(), DecodeVLDST3Instruction(), DecodeVLDST4Instruction(), DecodeVMOVModImmInstruction(), DecodeVMOVRRS(), DecodeVMOVSRR(), DecodeVSCCLRM(), DecodeVSHLMaxInstruction(), DecodeVST1LN(), DecodeVST2LN(), DecodeVST3LN(), DecodeVST4LN(), DecodeVSTInstruction(), llvm::AArch64_IMM::expandMOVImm(), expandMOVImmSimple(), findCommonDominator(), llvm::AArch64Disassembler::getInstruction(), llvm::LanaiDisassembler::getInstruction(), llvm::AArch64TTIImpl::getIntImmCost(), getNextMachineInstrInBB(), llvm::ImplicitControlFlowTracking::isDominatedByICFIFromSameBlock(), llvm::MemoryWriteTracking::isDominatedByMemoryWriteFromSameBlock(), llvm::AArch64TargetLowering::isFPImmLegal(), llvm::isGuardAsWidenableBranch(), llvm::AArch64TargetLowering::isMulAddWithConstProfitable(), llvm::InstructionPrecedenceTracking::isPreceededBySpecialInstruction(), llvm::ImplicitControlFlowTracking::isSpecialInstruction(), llvm::MemoryWriteTracking::isSpecialInstruction(), isSupportedGuardInstruction(), PostOperandDecodeAdjust(), readInstruction16(), readInstruction32(), readInstruction48(), readInstruction64(), llvm::RuntimeDyldMachOARM::resolveRelocation(), llvm::RISCVTargetLowering::shouldSinkOperands(), llvm::ARMTargetLowering::shouldSinkOperands(), and trySequenceOfOnes().

◆ LowestBitSet

unsigned LowestBitSet = countTrailingZeros(UImm)

Definition at line 96 of file AArch64MIPeepholeOpt.cpp.

◆ NewImm1

T NewImm1
Initial value:
= (static_cast<T>(2) << HighestBitSet) -
(static_cast<T>(1) << LowestBitSet)

Definition at line 101 of file AArch64MIPeepholeOpt.cpp.

◆ NewImm2

T NewImm2 = UImm | ~NewImm1

Definition at line 105 of file AArch64MIPeepholeOpt.cpp.

◆ RegSize

unsigned RegSize

◆ true

return true

Definition at line 114 of file AArch64MIPeepholeOpt.cpp.

T
HighestBitSet
unsigned HighestBitSet
Definition: AArch64MIPeepholeOpt.cpp:97
LowestBitSet
unsigned LowestBitSet
Definition: AArch64MIPeepholeOpt.cpp:96