LLVM 20.0.0git
Namespaces | Macros | Functions | Variables
ARCOptAddrMode.cpp File Reference

This pass folds LD/ST + ADD pairs into Pre/Post-increment form of load/store instructions. More...

#include "ARC.h"
#include "ARCInstrInfo.h"
#include "ARCTargetMachine.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define GET_INSTRMAP_INFO
 
#define OPTADDRMODE_DESC   "ARC load/store address mode"
 
#define OPTADDRMODE_NAME   "arc-addr-mode"
 
#define DEBUG_TYPE   "arc-addr-mode"
 
#define DUMP_BEFORE()   ((ArcKillAddrMode & 0x0001) != 0)
 
#define DUMP_AFTER()   ((ArcKillAddrMode & 0x0002) != 0)
 
#define VIEW_BEFORE()   ((ArcKillAddrMode & 0x0004) != 0)
 
#define VIEW_AFTER()   ((ArcKillAddrMode & 0x0008) != 0)
 
#define KILL_PASS()   ((ArcKillAddrMode & 0x0010) != 0)
 

Functions

FunctionPassllvm::createARCOptAddrMode ()
 
void llvm::initializeARCOptAddrModePass (PassRegistry &)
 
 INITIALIZE_PASS_BEGIN (ARCOptAddrMode, OPTADDRMODE_NAME, OPTADDRMODE_DESC, false, false) INITIALIZE_PASS_END(ARCOptAddrMode
 
static false bool isValidLoadStoreOffset (int64_t Off)
 
static bool isValidIncrementOffset (int64_t Off)
 
static bool isAddConstantOp (const MachineInstr &MI, int64_t &Amount)
 
static bool dominatesAllUsesOf (const MachineInstr *MI, unsigned VReg, MachineDominatorTree *MDT, MachineRegisterInfo *MRI)
 
static bool isLoadStoreThatCanHandleDisplacement (const TargetInstrInfo *TII, const MachineInstr &MI, int64_t Disp)
 

Variables

static cl::opt< unsignedllvm::ArcKillAddrMode ("arc-kill-addr-mode", cl::init(0), cl::ReallyHidden)
 
 OPTADDRMODE_NAME
 
 OPTADDRMODE_DESC
 
 false
 

Detailed Description

This pass folds LD/ST + ADD pairs into Pre/Post-increment form of load/store instructions.

Definition in file ARCOptAddrMode.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "arc-addr-mode"

Definition at line 34 of file ARCOptAddrMode.cpp.

◆ DUMP_AFTER

#define DUMP_AFTER ( )    ((ArcKillAddrMode & 0x0002) != 0)

Definition at line 42 of file ARCOptAddrMode.cpp.

◆ DUMP_BEFORE

#define DUMP_BEFORE ( )    ((ArcKillAddrMode & 0x0001) != 0)

Definition at line 41 of file ARCOptAddrMode.cpp.

◆ GET_INSTRMAP_INFO

#define GET_INSTRMAP_INFO

Definition at line 15 of file ARCOptAddrMode.cpp.

◆ KILL_PASS

#define KILL_PASS ( )    ((ArcKillAddrMode & 0x0010) != 0)

Definition at line 45 of file ARCOptAddrMode.cpp.

◆ OPTADDRMODE_DESC

#define OPTADDRMODE_DESC   "ARC load/store address mode"

Definition at line 32 of file ARCOptAddrMode.cpp.

◆ OPTADDRMODE_NAME

#define OPTADDRMODE_NAME   "arc-addr-mode"

Definition at line 33 of file ARCOptAddrMode.cpp.

◆ VIEW_AFTER

#define VIEW_AFTER ( )    ((ArcKillAddrMode & 0x0008) != 0)

Definition at line 44 of file ARCOptAddrMode.cpp.

◆ VIEW_BEFORE

#define VIEW_BEFORE ( )    ((ArcKillAddrMode & 0x0004) != 0)

Definition at line 43 of file ARCOptAddrMode.cpp.

Function Documentation

◆ dominatesAllUsesOf()

static bool dominatesAllUsesOf ( const MachineInstr MI,
unsigned  VReg,
MachineDominatorTree MDT,
MachineRegisterInfo MRI 
)
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( ARCOptAddrMode  ,
OPTADDRMODE_NAME  ,
OPTADDRMODE_DESC  ,
false  ,
false   
)

◆ isAddConstantOp()

static bool isAddConstantOp ( const MachineInstr MI,
int64_t &  Amount 
)
static

Definition at line 134 of file ARCOptAddrMode.cpp.

References assert(), and MI.

◆ isLoadStoreThatCanHandleDisplacement()

static bool isLoadStoreThatCanHandleDisplacement ( const TargetInstrInfo TII,
const MachineInstr MI,
int64_t  Disp 
)
static

◆ isValidIncrementOffset()

static bool isValidIncrementOffset ( int64_t  Off)
static

Definition at line 132 of file ARCOptAddrMode.cpp.

◆ isValidLoadStoreOffset()

static false bool isValidLoadStoreOffset ( int64_t  Off)
static

Definition at line 128 of file ARCOptAddrMode.cpp.

Referenced by isLoadStoreThatCanHandleDisplacement().

Variable Documentation

◆ false

false

Definition at line 123 of file ARCOptAddrMode.cpp.

◆ OPTADDRMODE_DESC

OPTADDRMODE_DESC

Definition at line 123 of file ARCOptAddrMode.cpp.

◆ OPTADDRMODE_NAME

OPTADDRMODE_NAME

Definition at line 123 of file ARCOptAddrMode.cpp.