LLVM  8.0.1
Macros | Functions | Variables
X86AvoidStoreForwardingBlocks.cpp File Reference
#include "X86InstrInfo.h"
#include "X86Subtarget.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/MC/MCInstrDesc.h"
Include dependency graph for X86AvoidStoreForwardingBlocks.cpp:

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 (int LdOpcode, int StOpcode)
 
static bool isPotentialBlockingStoreInst (int Opcode, int LoadOpcode)
 
static unsigned getYMMtoXMMLoadOpcode (unsigned LoadOpcode)
 
static unsigned getYMMtoXMMStoreOpcode (unsigned StoreOpcode)
 
static int getAddrOffset (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 53 of file X86AvoidStoreForwardingBlocks.cpp.

Function Documentation

◆ findPotentialBlockers()

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

◆ getAddrOffset()

static int getAddrOffset ( MachineInstr MI)
static

◆ getBaseOperand()

static MachineOperand& getBaseOperand ( MachineInstr MI)
static

◆ getDispOperand()

static MachineOperand& getDispOperand ( MachineInstr MI)
static

◆ getYMMtoXMMLoadOpcode()

static unsigned getYMMtoXMMLoadOpcode ( unsigned  LoadOpcode)
static

Definition at line 233 of file X86AvoidStoreForwardingBlocks.cpp.

References llvm_unreachable.

Referenced by findPotentialBlockers().

◆ getYMMtoXMMStoreOpcode()

static unsigned getYMMtoXMMStoreOpcode ( unsigned  StoreOpcode)
static

Definition at line 262 of file X86AvoidStoreForwardingBlocks.cpp.

References llvm_unreachable.

Referenced by findPotentialBlockers().

◆ 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.

Referenced by removeRedundantBlockingStores().

◆ isPotentialBlockedMemCpyLd()

static bool isPotentialBlockedMemCpyLd ( unsigned  Opcode)
static

Definition at line 153 of file X86AvoidStoreForwardingBlocks.cpp.

References isXMMLoadOpcode(), and isYMMLoadOpcode().

Referenced by updateKillStatus().

◆ isPotentialBlockedMemCpyPair()

static bool isPotentialBlockedMemCpyPair ( int  LdOpcode,
int  StOpcode 
)
static

Definition at line 157 of file X86AvoidStoreForwardingBlocks.cpp.

Referenced by updateKillStatus().

◆ isPotentialBlockingStoreInst()

static bool isPotentialBlockingStoreInst ( int  Opcode,
int  LoadOpcode 
)
static

Definition at line 209 of file X86AvoidStoreForwardingBlocks.cpp.

References isYMMLoadOpcode().

Referenced by removeRedundantBlockingStores().

◆ 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.

Referenced by removeRedundantBlockingStores().

◆ 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))
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.

Referenced by findPotentialBlockers().

◆ MOV16SZ

const int MOV16SZ = 2
static

Definition at line 230 of file X86AvoidStoreForwardingBlocks.cpp.

Referenced by findPotentialBlockers().

◆ MOV32SZ

const int MOV32SZ = 4
static

Definition at line 229 of file X86AvoidStoreForwardingBlocks.cpp.

Referenced by findPotentialBlockers().

◆ MOV64SZ

const int MOV64SZ = 8
static

Definition at line 228 of file X86AvoidStoreForwardingBlocks.cpp.

Referenced by findPotentialBlockers().

◆ MOV8SZ

const int MOV8SZ = 1
static

Definition at line 231 of file X86AvoidStoreForwardingBlocks.cpp.

Referenced by findPotentialBlockers().

◆ 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)
static

Referenced by findPotentialBlockers().