summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-09 21:23:02 +0000
committerDan Gohman <gohman@apple.com>2008-07-09 21:23:02 +0000
commit89e71d48b8433fcb7657dedfe3b072a9148aa8af (patch)
tree7288a6c1c3cbd1a1bab77ac7886d7d82c83e572c /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentc4650f4b566f49383530d011493e26c970ba57bc (diff)
downloadbcm5719-llvm-89e71d48b8433fcb7657dedfe3b072a9148aa8af.tar.gz
bcm5719-llvm-89e71d48b8433fcb7657dedfe3b072a9148aa8af.zip
Move the IsVolatile and SVOffset fields into the MemSDNode base
class, and store IsVolatile and Alignment in a more compact form. This makes AtomicSDNode slightly larger, but it shrinks LoadSDNode and StoreSDNode, which are much more common and are the largest of the SDNode subclasses. Also, this lets the isVolatile() and getAlignment() accessors be non-virtual. llvm-svn: 53361
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 5d814ef0c90..39cce98f6bd 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -4331,6 +4331,17 @@ GlobalAddressSDNode::GlobalAddressSDNode(bool isTarget, const GlobalValue *GA,
TheGlobal = const_cast<GlobalValue*>(GA);
}
+MemSDNode::MemSDNode(unsigned Opc, SDVTList VTs,
+ const Value *srcValue, int SVO,
+ unsigned alignment, bool vol)
+ : SDNode(Opc, VTs), SrcValue(srcValue), SVOffset(SVO),
+ Flags(vol | ((Log2_32(alignment) + 1) << 1)) {
+
+ assert(isPowerOf2_32(alignment) && "Alignment is not a power of 2!");
+ assert(getAlignment() == alignment && "Alignment representation error!");
+ assert(isVolatile() == vol && "Volatile representation error!");
+}
+
/// getMemOperand - Return a MachineMemOperand object describing the memory
/// reference performed by this atomic.
MachineMemOperand AtomicSDNode::getMemOperand() const {
OpenPOWER on IntegriCloud