Re-apply the memory operand changes, with a fix for the static

initializer problem, a minor tweak to the way the
DAGISelEmitter finds load/store nodes, and a renaming of the
new PseudoSourceValue objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2008-02-06 22:27:42 +00:00
parent b745e88bf0
commit 69de1932b3
21 changed files with 595 additions and 157 deletions

View File

@@ -17,6 +17,7 @@
#define LLVM_CODEGEN_MACHINEINSTR_H
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MemOperand.h"
namespace llvm {
@@ -35,6 +36,7 @@ class MachineInstr {
// are determined at construction time).
std::vector<MachineOperand> Operands; // the operands
std::vector<MemOperand> MemOperands; // information on memory references
MachineInstr *Prev, *Next; // Links for MBB's intrusive list.
MachineBasicBlock *Parent; // Pointer to the owning basic block.
@@ -94,6 +96,18 @@ public:
///
unsigned getNumExplicitOperands() const;
/// Access to memory operands of the instruction
unsigned getNumMemOperands() const { return MemOperands.size(); }
const MemOperand& getMemOperand(unsigned i) const {
assert(i < getNumMemOperands() && "getMemOperand() out of range!");
return MemOperands[i];
}
MemOperand& getMemOperand(unsigned i) {
assert(i < getNumMemOperands() && "getMemOperand() out of range!");
return MemOperands[i];
}
/// isIdenticalTo - Return true if this instruction is identical to (same
/// opcode and same operands as) the specified instruction.
bool isIdenticalTo(const MachineInstr *Other) const {
@@ -196,6 +210,12 @@ public:
///
void RemoveOperand(unsigned i);
/// addMemOperand - Add a MemOperand to the machine instruction, referencing
/// arbitrary storage.
void addMemOperand(const MemOperand &MO) {
MemOperands.push_back(MO);
}
private:
/// getRegInfo - If this instruction is embedded into a MachineFunction,
/// return the MachineRegisterInfo object for the current function, otherwise