Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Macros |Functions |Variables
LoadStoreOpt.cpp File Reference

This file implements the LoadStoreOpt optimization pass.More...

#include "llvm/CodeGen/GlobalISel/LoadStoreOpt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
#include "llvm/CodeGen/GlobalISel/MIPatternMatch.h"
#include "llvm/CodeGen/GlobalISel/Utils.h"
#include "llvm/CodeGen/LowLevelTypeUtils.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Register.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include <algorithm>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loadstore-opt"
 

Functions

 STATISTIC (NumStoresMerged, "Number ofstores merged")
 
 INITIALIZE_PASS_BEGIN (LoadStoreOpt,DEBUG_TYPE, "Generic memory optimizations", false, false)INITIALIZE_PASS_END(LoadStoreOpt
 
staticbool isInstHardMergeHazard (MachineInstr &MI)
 Returns true if the instruction creates an unavoidable hazard that forces a boundary between store merge candidates.
 
static std::optional< int64_t > getTruncStoreByteOffset (GStore &Store,Register &SrcVal,MachineRegisterInfo &MRI)
 Check if the storeStore is a truncstore that can be merged.
 

Variables

constunsigned MaxStoreSizeToForm = 128
 
 DEBUG_TYPE
 
Generic memory optimizations
 
Generic memory false
 

Detailed Description

This file implements the LoadStoreOpt optimization pass.

Definition in fileLoadStoreOpt.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loadstore-opt"

Definition at line41 of fileLoadStoreOpt.cpp.

Function Documentation

◆ getTruncStoreByteOffset()

static std::optional< int64_t > getTruncStoreByteOffset(GStoreStore,
RegisterSrcVal,
MachineRegisterInfoMRI 
)
static

Check if the storeStore is a truncstore that can be merged.

That is, it's a store of a shifted value ofSrcVal. IfSrcVal is an empty Register then it does not need to match and SrcVal is set to the source value found. On match, returns the start byte offset of theSrcVal that is being stored.

Definition at line649 of fileLoadStoreOpt.cpp.

Referencesllvm::Register::isValid(),llvm::MIPatternMatch::m_any_of(),llvm::MIPatternMatch::m_GAShr(),llvm::MIPatternMatch::m_GLShr(),llvm::MIPatternMatch::m_GTrunc(),llvm::MIPatternMatch::m_ICst(),llvm::MIPatternMatch::m_Reg(),llvm::MIPatternMatch::mi_match(),MRI, andllvm::Offset.

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN(LoadStoreOpt ,
DEBUG_TYPE ,
"Generic memory optimizations" ,
false ,
false  
)

◆ isInstHardMergeHazard()

staticbool isInstHardMergeHazard(MachineInstrMI)
static

Returns true if the instruction creates an unavoidable hazard that forces a boundary between store merge candidates.

Definition at line300 of fileLoadStoreOpt.cpp.

ReferencesMI.

◆ STATISTIC()

STATISTIC(NumStoresMerged ,
"Number ofstores merged"  
)

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line54 of fileLoadStoreOpt.cpp.

◆ false

Generic memory false

Definition at line55 of fileLoadStoreOpt.cpp.

◆ MaxStoreSizeToForm

constunsigned MaxStoreSizeToForm = 128

Definition at line49 of fileLoadStoreOpt.cpp.

◆ optimizations

Generic memory optimizations

Definition at line54 of fileLoadStoreOpt.cpp.


Generated on Sun Jul 20 2025 15:02:59 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp