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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53361 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2008-07-09 21:23:02 +00:00
parent f2452c5f48
commit 492f276cbc
2 changed files with 28 additions and 28 deletions

View File

@ -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 {