30 #define DEBUG_TYPE "ppc-qpx-load-splat"
32 STATISTIC(NumSimplified,
"Number of QPX load splats simplified");
48 return "PowerPC QPX Load Splat Simplification";
55 "PowerPC QPX Load Splat Simplification",
59 return new PPCQPXLoadSplat();
66 bool MadeChange =
false;
69 for (
auto MFI = MF.
begin(), MFIE = MF.
end(); MFI != MFIE; ++MFI) {
73 for (
auto MBBI = MBB->
rbegin(); MBBI != MBB->
rend(); ++MBBI) {
85 for (
auto SI = Splats.
begin();
SI != Splats.
end();) {
105 if (SplatReg != SrcReg) {
108 unsigned SubRegIndex =
110 unsigned SplatSubReg = TRI->
getSubReg(SplatReg, SubRegIndex);
140 (SrcReg != SplatReg &&
void push_back(const T &Elt)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
STATISTIC(NumFunctions,"Total number of functions")
void initializePPCQPXLoadSplatPass(PassRegistry &)
INITIALIZE_PASS(PPCQPXLoadSplat,"ppc-qpx-load-splat","PowerPC QPX Load Splat Simplification", false, false) FunctionPass *llvm
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
unsigned getSubRegIndex(unsigned RegNo, unsigned SubRegNo) const
For a given register pair, return the sub-register index if the second register is a sub-register of ...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
reverse_iterator rbegin()
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
const MachineOperand & getOperand(unsigned i) const
unsigned getSubReg(unsigned Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo...
bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore...
FunctionPass class - This class is used to implement most global optimizations.
GPRC, CHAIN = LFIWAX CHAIN, Ptr - This is a floating-point load which sign-extends from a 32-bit inte...
QVESPLATI = This corresponds to the QPX qvesplati instruction.
iterator erase(const_iterator CI)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI=nullptr) const
Return true if the MachineInstr reads the specified register.
void substituteRegister(unsigned FromReg, unsigned ToReg, unsigned SubIdx, const TargetRegisterInfo &RegInfo)
Replace all occurrences of FromReg with ToReg:SubIdx, properly composing subreg indices where necessa...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Representation of each machine instruction.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
FunctionPass * createPPCQPXLoadSplatPass()
void setReg(unsigned Reg)
Change the register this operand corresponds to.
bool isCall(QueryType Type=AnyInBundle) const
unsigned getReg() const
getReg - Returns the register number.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
GPRC, CHAIN = LFIWZX CHAIN, Ptr - This is a floating-point load which zero-extends from a 32-bit inte...
bool modifiesRegister(unsigned Reg, const TargetRegisterInfo *TRI) const
Return true if the MachineInstr modifies (fully define or partially define) the specified register...