LLVM 20.0.0git |
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 |
This file implements the LoadStoreOpt optimization pass.
Definition in fileLoadStoreOpt.cpp.
#define DEBUG_TYPE "loadstore-opt" |
Definition at line41 of fileLoadStoreOpt.cpp.
| 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 | ( | LoadStoreOpt | , |
DEBUG_TYPE | , | ||
"Generic memory optimizations" | , | ||
false | , | ||
false | |||
) |
| 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 | ( | NumStoresMerged | , |
"Number ofstores merged" | |||
) |
DEBUG_TYPE |
Definition at line54 of fileLoadStoreOpt.cpp.
Generic memory false |
Definition at line55 of fileLoadStoreOpt.cpp.
Definition at line49 of fileLoadStoreOpt.cpp.
Generic memory optimizations |
Definition at line54 of fileLoadStoreOpt.cpp.