aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/SelectionDAGNodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h47
1 files changed, 39 insertions, 8 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 0509076352..9cb58c9329 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -25,6 +25,7 @@
#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>
@@ -542,11 +543,15 @@ namespace ISD {
// pointer, and a SRCVALUE.
VAEND, VASTART,
- // 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 - This is a node type that holds a Value* that is used to
+ // make reference to a value in the LLVM IR.
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,
@@ -1391,17 +1396,16 @@ 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;
- SrcValueSDNode(const Value* v, int o)
- : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v), offset(o) {
- }
+ /// Create a SrcValue for a general value.
+ explicit SrcValueSDNode(const Value *v)
+ : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v) {}
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) {
@@ -1410,6 +1414,29 @@ 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.
@@ -1559,6 +1586,10 @@ 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 ||