LLVM 20.0.0git
Macros | Functions | Variables
X86AvoidStoreForwardingBlocks.cpp File Reference
#include "X86.h"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
#include "llvm/InitializePasses.h"
#include "llvm/MC/MCInstrDesc.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86-avoid-SFB"
 

Functions

 INITIALIZE_PASS_BEGIN (X86AvoidSFBPass, DEBUG_TYPE, "Machine code sinking", false, false) INITIALIZE_PASS_END(X86AvoidSFBPass
 
static bool isXMMLoadOpcode (unsigned Opcode)
 
static bool isYMMLoadOpcode (unsigned Opcode)
 
static bool isPotentialBlockedMemCpyLd (unsigned Opcode)
 
static bool isPotentialBlockedMemCpyPair (unsigned LdOpcode, unsigned StOpcode)
 
static bool isPotentialBlockingStoreInst (unsigned Opcode, unsigned LoadOpcode)
 
static unsigned getYMMtoXMMLoadOpcode (unsigned LoadOpcode)
 
static unsigned getYMMtoXMMStoreOpcode (unsigned StoreOpcode)
 
static int getAddrOffset (const MachineInstr *MI)
 
static MachineOperandgetBaseOperand (MachineInstr *MI)
 
static MachineOperandgetDispOperand (MachineInstr *MI)
 
static bool isRelevantAddressingMode (MachineInstr *MI)
 
static SmallVector< MachineInstr *, 2 > findPotentialBlockers (MachineInstr *LoadInst)
 
static void updateKillStatus (MachineInstr *LoadInst, MachineInstr *StoreInst)
 
static bool hasSameBaseOpValue (MachineInstr *LoadInst, MachineInstr *StoreInst)
 
static bool isBlockingStore (int64_t LoadDispImm, unsigned LoadSize, int64_t StoreDispImm, unsigned StoreSize)
 
static void updateBlockingStoresDispSizeMap (DisplacementSizeMap &BlockingStoresDispSizeMap, int64_t DispImm, unsigned Size)
 
static void removeRedundantBlockingStores (DisplacementSizeMap &BlockingStoresDispSizeMap)
 

Variables

static cl::opt< boolDisableX86AvoidStoreForwardBlocks ("x86-disable-avoid-SFB", cl::Hidden, cl::desc("X86: Disable Store Forwarding Blocks fixup."), cl::init(false))
 
static cl::opt< unsignedX86AvoidSFBInspectionLimit ("x86-sfb-inspection-limit", cl::desc("X86: Number of instructions backward to " "inspect for store forwarding blocks."), cl::init(20), cl::Hidden)
 
 DEBUG_TYPE
 
Machine code sinking
 
Machine code false
 
static const int MOV128SZ = 16
 
static const int MOV64SZ = 8
 
static const int MOV32SZ = 4
 
static const int MOV16SZ = 2
 
static const int MOV8SZ = 1
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "x86-avoid-SFB"

Definition at line 55 of file X86AvoidStoreForwardingBlocks.cpp.

Function Documentation

◆ findPotentialBlockers()

static SmallVector< MachineInstr *, 2 > findPotentialBlockers ( MachineInstr LoadInst)
static

◆ getAddrOffset()

static int getAddrOffset ( const MachineInstr MI)
static

◆ getBaseOperand()

static MachineOperand & getBaseOperand ( MachineInstr MI)
static

◆ getDispOperand()

static MachineOperand & getDispOperand ( MachineInstr MI)
static

Definition at line 304 of file X86AvoidStoreForwardingBlocks.cpp.

References llvm::X86::AddrDisp, getAddrOffset(), and MI.

Referenced by isRelevantAddressingMode().

◆ getYMMtoXMMLoadOpcode()

static unsigned getYMMtoXMMLoadOpcode ( unsigned  LoadOpcode)
static

Definition at line 233 of file X86AvoidStoreForwardingBlocks.cpp.

References llvm_unreachable.

◆ getYMMtoXMMStoreOpcode()

static unsigned getYMMtoXMMStoreOpcode ( unsigned  StoreOpcode)
static

Definition at line 262 of file X86AvoidStoreForwardingBlocks.cpp.

References llvm_unreachable.

◆ hasSameBaseOpValue()

static bool hasSameBaseOpValue ( MachineInstr LoadInst,
MachineInstr StoreInst 
)
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( X86AvoidSFBPass  ,
DEBUG_TYPE  ,
"Machine code sinking"  ,
false  ,
false   
)

◆ isBlockingStore()

static bool isBlockingStore ( int64_t  LoadDispImm,
unsigned  LoadSize,
int64_t  StoreDispImm,
unsigned  StoreSize 
)
static

Definition at line 619 of file X86AvoidStoreForwardingBlocks.cpp.

◆ isPotentialBlockedMemCpyLd()

static bool isPotentialBlockedMemCpyLd ( unsigned  Opcode)
static

Definition at line 153 of file X86AvoidStoreForwardingBlocks.cpp.

References isXMMLoadOpcode(), and isYMMLoadOpcode().

◆ isPotentialBlockedMemCpyPair()

static bool isPotentialBlockedMemCpyPair ( unsigned  LdOpcode,
unsigned  StOpcode 
)
static

Definition at line 157 of file X86AvoidStoreForwardingBlocks.cpp.

◆ isPotentialBlockingStoreInst()

static bool isPotentialBlockingStoreInst ( unsigned  Opcode,
unsigned  LoadOpcode 
)
static

Definition at line 209 of file X86AvoidStoreForwardingBlocks.cpp.

References isYMMLoadOpcode().

◆ isRelevantAddressingMode()

static bool isRelevantAddressingMode ( MachineInstr MI)
static

◆ isXMMLoadOpcode()

static bool isXMMLoadOpcode ( unsigned  Opcode)
static

Definition at line 133 of file X86AvoidStoreForwardingBlocks.cpp.

Referenced by isPotentialBlockedMemCpyLd().

◆ isYMMLoadOpcode()

static bool isYMMLoadOpcode ( unsigned  Opcode)
static

◆ removeRedundantBlockingStores()

static void removeRedundantBlockingStores ( DisplacementSizeMap &  BlockingStoresDispSizeMap)
static

◆ updateBlockingStoresDispSizeMap()

static void updateBlockingStoresDispSizeMap ( DisplacementSizeMap &  BlockingStoresDispSizeMap,
int64_t  DispImm,
unsigned  Size 
)
static

Definition at line 627 of file X86AvoidStoreForwardingBlocks.cpp.

References Size.

◆ updateKillStatus()

static void updateKillStatus ( MachineInstr LoadInst,
MachineInstr StoreInst 
)
static

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 126 of file X86AvoidStoreForwardingBlocks.cpp.

◆ DisableX86AvoidStoreForwardBlocks

cl::opt< bool > DisableX86AvoidStoreForwardBlocks("x86-disable-avoid-SFB", cl::Hidden, cl::desc("X86: Disable Store Forwarding Blocks fixup."), cl::init(false)) ( "x86-disable-avoid-SFB"  ,
cl::Hidden  ,
cl::desc("X86: Disable Store Forwarding Blocks fixup.")  ,
cl::init(false)   
)
static

◆ false

Machine code false

Definition at line 126 of file X86AvoidStoreForwardingBlocks.cpp.

◆ MOV128SZ

const int MOV128SZ = 16
static

Definition at line 227 of file X86AvoidStoreForwardingBlocks.cpp.

◆ MOV16SZ

const int MOV16SZ = 2
static

Definition at line 230 of file X86AvoidStoreForwardingBlocks.cpp.

◆ MOV32SZ

const int MOV32SZ = 4
static

Definition at line 229 of file X86AvoidStoreForwardingBlocks.cpp.

◆ MOV64SZ

const int MOV64SZ = 8
static

Definition at line 228 of file X86AvoidStoreForwardingBlocks.cpp.

◆ MOV8SZ

const int MOV8SZ = 1
static

Definition at line 231 of file X86AvoidStoreForwardingBlocks.cpp.

◆ sinking

Machine code sinking

Definition at line 126 of file X86AvoidStoreForwardingBlocks.cpp.

◆ X86AvoidSFBInspectionLimit

cl::opt< unsigned > X86AvoidSFBInspectionLimit("x86-sfb-inspection-limit", cl::desc("X86: Number of instructions backward to " "inspect for store forwarding blocks."), cl::init(20), cl::Hidden) ( "x86-sfb-inspection-limit"  ,
cl::desc("X86: Number of instructions backward to " "inspect for store forwarding blocks.")  ,
cl::init(20)  ,
cl::Hidden   
)
static

Referenced by findPotentialBlockers().