summaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-01-31 21:00:00 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-01-31 21:00:00 +0000
commit334dc1f58d617dcff969a2e107febaae42bbc883 (patch)
tree72e10086f526e55c2e3770b765277e0ec2a28fec /include/llvm
parentb63fa050b75b1aefbd6b0dac23ca789fac29128b (diff)
downloadexternal_llvm-334dc1f58d617dcff969a2e107febaae42bbc883.zip
external_llvm-334dc1f58d617dcff969a2e107febaae42bbc883.tar.gz
external_llvm-334dc1f58d617dcff969a2e107febaae42bbc883.tar.bz2
Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and re-commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46623 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h20
-rw-r--r--include/llvm/CodeGen/MachineInstrBuilder.h6
-rw-r--r--include/llvm/CodeGen/MemOperand.h82
-rw-r--r--include/llvm/CodeGen/PseudoSourceValue.h62
-rw-r--r--include/llvm/CodeGen/ScheduleDAG.h13
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h8
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h47
-rw-r--r--include/llvm/Value.h1
8 files changed, 13 insertions, 226 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 8b0931a..7c0bed8 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -17,7 +17,6 @@
#define LLVM_CODEGEN_MACHINEINSTR_H
#include "llvm/CodeGen/MachineOperand.h"
-#include "llvm/CodeGen/MemOperand.h"
namespace llvm {
@@ -36,7 +35,6 @@ 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.
@@ -96,18 +94,6 @@ 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 {
@@ -210,12 +196,6 @@ 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
diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h
index 5190060..97d6736 100644
--- a/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -83,12 +83,6 @@ public:
MI->addOperand(MachineOperand::CreateES(FnName, 0));
return *this;
}
-
- /// addMemOperand - Add a memory operand to the machine instruction.
- const MachineInstrBuilder &addMemOperand(const MemOperand &MO) const {
- MI->addMemOperand(MO);
- return *this;
- }
};
/// BuildMI - Builder interface. Specify how to create the initial instruction
diff --git a/include/llvm/CodeGen/MemOperand.h b/include/llvm/CodeGen/MemOperand.h
index e9f05f3..e69de29 100644
--- a/include/llvm/CodeGen/MemOperand.h
+++ b/include/llvm/CodeGen/MemOperand.h
@@ -1,82 +0,0 @@
-//===-- llvm/CodeGen/MemOperand.h - MemOperand class ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the MemOperand class, which is a
-// description of a memory reference. It is used to help track dependencies
-// in the backend.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MEMOPERAND_H
-#define LLVM_CODEGEN_MEMOPERAND_H
-
-namespace llvm {
-
-class Value;
-
-//===----------------------------------------------------------------------===//
-/// MemOperand - A description of a memory reference used in the backend.
-/// Instead of holding a StoreInst or LoadInst, this class holds the address
-/// Value of the reference along with a byte size and offset. This allows it
-/// to describe lowered loads and stores. Also, the special PseudoSourceValue
-/// objects can be used to represent loads and stores to memory locations
-/// that aren't explicit in the regular LLVM IR.
-///
-class MemOperand {
- const Value *V;
- unsigned int Flags;
- int Offset;
- int Size;
- unsigned int Alignment;
-
-public:
- /// Flags values. These may be or'd together.
- enum MemOperandFlags {
- /// The memory access reads data.
- MOLoad = 1,
- /// The memory access writes data.
- MOStore = 2,
- /// The memory access is volatile.
- MOVolatile = 4
- };
-
- /// MemOperand - Construct an MemOperand object with the specified
- /// address Value, flags, offset, size, and alignment.
- MemOperand(const Value *v, unsigned int f, int o, int s, unsigned int a)
- : V(v), Flags(f), Offset(o), Size(s), Alignment(a) {}
-
- /// getValue - Return the base address of the memory access.
- /// Special values are PseudoSourceValue::FPRel, PseudoSourceValue::SPRel,
- /// and the other PseudoSourceValue members which indicate references to
- /// frame/stack pointer relative references and other special references.
- const Value *getValue() const { return V; }
-
- /// getFlags - Return the raw flags of the source value, \see MemOperandFlags.
- unsigned int getFlags() const { return Flags; }
-
- /// getOffset - For normal values, this is a byte offset added to the base
- /// address. For PseudoSourceValue::FPRel values, this is the FrameIndex
- /// number.
- int getOffset() const { return Offset; }
-
- /// getSize - Return the size in bytes of the memory reference.
- int getSize() const { return Size; }
-
- /// getAlignment - Return the minimum known alignment in bytes of the
- /// memory reference.
- unsigned int getAlignment() const { return Alignment; }
-
- bool isLoad() const { return Flags & MOLoad; }
- bool isStore() const { return Flags & MOStore; }
- bool isVolatile() const { return Flags & MOVolatile; }
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/include/llvm/CodeGen/PseudoSourceValue.h b/include/llvm/CodeGen/PseudoSourceValue.h
index bae7e23..e69de29 100644
--- a/include/llvm/CodeGen/PseudoSourceValue.h
+++ b/include/llvm/CodeGen/PseudoSourceValue.h
@@ -1,62 +0,0 @@
-//===-- llvm/CodeGen/PseudoSourceValue.h ------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the PseudoSourceValue class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
-#define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
-
-#include "llvm/Value.h"
-
-namespace llvm {
- /// PseudoSourceValue - Special value supplied for machine level alias
- /// analysis. It indicates that the a memory access references the functions
- /// stack frame (e.g., a spill slot), below the stack frame (e.g., argument
- /// space), or constant pool.
- class PseudoSourceValue : public Value {
- const char *name;
- public:
- explicit PseudoSourceValue(const char *_name);
-
- virtual void print(std::ostream &OS) const;
-
- /// classof - Methods for support type inquiry through isa, cast, and
- /// dyn_cast:
- ///
- static inline bool classof(const PseudoSourceValue *) { return true; }
- static inline bool classof(const Value *V) {
- return V->getValueID() == PseudoSourceValueVal;
- }
-
- /// A pseudo source value referencing to the stack frame of a function,
- /// e.g., a spill slot.
- static const PseudoSourceValue FPRel;
-
- /// A source value referencing the area below the stack frame of a function,
- /// e.g., the argument space.
- static const PseudoSourceValue SPRel;
-
- /// A source value referencing the global offset table (or something the
- /// like).
- static const PseudoSourceValue GPRel;
-
- /// A source value relative to some kind of thread id/pointer.
- static const PseudoSourceValue TPRel;
-
- /// A SV referencing the constant pool
- static const PseudoSourceValue CPRel;
-
- /// A SV referencing the jump table
- static const PseudoSourceValue JTRel;
- };
-} // End llvm namespace
-
-#endif
diff --git a/include/llvm/CodeGen/ScheduleDAG.h b/include/llvm/CodeGen/ScheduleDAG.h
index fdd5700..77d1a1c 100644
--- a/include/llvm/CodeGen/ScheduleDAG.h
+++ b/include/llvm/CodeGen/ScheduleDAG.h
@@ -279,7 +279,6 @@ namespace llvm {
if (isa<ConstantPoolSDNode>(Node)) return true;
if (isa<JumpTableSDNode>(Node)) return true;
if (isa<ExternalSymbolSDNode>(Node)) return true;
- if (isa<MemOperandSDNode>(Node)) return true;
return false;
}
@@ -313,15 +312,11 @@ namespace llvm {
/// (which do not go into the machine instrs.)
static unsigned CountResults(SDNode *Node);
- /// CountOperands - The inputs to target nodes have any actual inputs first,
- /// followed by optional memory operands chain operand, then flag operands.
- /// Compute the number of actual operands that will go into the machine
- /// instr.
+ /// CountOperands The inputs to target nodes have any actual inputs first,
+ /// followed by an optional chain operand, then flag operands. Compute the
+ /// number of actual operands that will go into the machine instr.
static unsigned CountOperands(SDNode *Node);
- /// CountMemOperands - Find the index of the last MemOperandSDNode
- static unsigned CountMemOperands(SDNode *Node);
-
/// EmitNode - Generate machine code for an node and needed dependencies.
/// VRBaseMap contains, for each already emitted node, the first virtual
/// register number for the results of the node.
@@ -362,8 +357,6 @@ namespace llvm {
void AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum,
const TargetInstrDesc *II,
DenseMap<SDOperand, unsigned> &VRBaseMap);
-
- void AddMemOperand(MachineInstr *MI, const MemOperand &MO);
};
/// createBURRListDAGScheduler - This creates a bottom up register usage
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index 9730112..a9ad9a4 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -381,12 +381,8 @@ public:
SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
SDOperand Offset, ISD::MemIndexedMode AM);
- // getSrcValue - Construct a node to track a Value* through the backend.
- SDOperand getSrcValue(const Value *v);
-
- // getMemOperand - Construct a node to track a memory reference
- // through the backend.
- SDOperand getMemOperand(const MemOperand &MO);
+ // getSrcValue - construct a node to track a Value* through the backend
+ SDOperand getSrcValue(const Value* I, int offset = 0);
/// UpdateNodeOperands - *Mutate* the specified node in-place to have the
/// specified operands. If the resultant node already exists in the DAG,
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index cb4ac72..d0011c3 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -25,7 +25,6 @@
#include "llvm/ADT/iterator"
#include "llvm/ADT/APFloat.h"
#include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MemOperand.h"
#include "llvm/Support/DataTypes.h"
#include <cassert>
@@ -537,15 +536,11 @@ namespace ISD {
// pointer, and a SRCVALUE.
VAEND, VASTART,
- // SRCVALUE - This is a node type that holds a Value* that is used to
- // make reference to a value in the LLVM IR.
+ // SRCVALUE - This corresponds to a Value*, and is used to associate memory
+ // locations with their value. This allows one use alias analysis
+ // information in the backend.
SRCVALUE,
- // MEMOPERAND - This is a node that contains a MemOperand which records
- // information about a memory reference. This is used to make AliasAnalysis
- // queries from the backend.
- MEMOPERAND,
-
// PCMARKER - This corresponds to the pcmarker intrinsic.
PCMARKER,
@@ -1390,16 +1385,17 @@ public:
class SrcValueSDNode : public SDNode {
const Value *V;
+ int offset;
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- /// Create a SrcValue for a general value.
- explicit SrcValueSDNode(const Value *v)
- : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v) {}
+ SrcValueSDNode(const Value* v, int o)
+ : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v), offset(o) {
+ }
public:
- /// getValue - return the contained Value.
const Value *getValue() const { return V; }
+ int getOffset() const { return offset; }
static bool classof(const SrcValueSDNode *) { return true; }
static bool classof(const SDNode *N) {
@@ -1408,29 +1404,6 @@ public:
};
-/// MemOperandSDNode - An SDNode that holds a MemOperand. This is
-/// used to represent a reference to memory after ISD::LOAD
-/// and ISD::STORE have been lowered.
-///
-class MemOperandSDNode : public SDNode {
- virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
-protected:
- friend class SelectionDAG;
- /// Create a MemOperand node
- explicit MemOperandSDNode(MemOperand mo)
- : SDNode(ISD::MEMOPERAND, getSDVTList(MVT::Other)), MO(mo) {}
-
-public:
- /// MO - The contained MemOperand.
- const MemOperand MO;
-
- static bool classof(const MemOperandSDNode *) { return true; }
- static bool classof(const SDNode *N) {
- return N->getOpcode() == ISD::MEMOPERAND;
- }
-};
-
-
class RegisterSDNode : public SDNode {
unsigned Reg;
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
@@ -1580,10 +1553,6 @@ public:
/// isUnindexed - Return true if this is NOT a pre/post inc/dec load/store.
bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
- /// getMemOperand - Return a MemOperand object describing the memory
- /// reference performed by this load or store.
- MemOperand getMemOperand() const;
-
static bool classof(const LSBaseSDNode *N) { return true; }
static bool classof(const SDNode *N) {
return N->getOpcode() == ISD::LOAD ||
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index e1cc6f2..fc1cf48 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -188,7 +188,6 @@ public:
ConstantPointerNullVal, // This is an instance of ConstantPointerNull
InlineAsmVal, // This is an instance of InlineAsm
InstructionVal, // This is an instance of Instruction
- PseudoSourceValueVal, // This is an instance of PseudoSourceValue
// Markers:
ConstantFirstVal = FunctionVal,