mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-12 22:26:14 +00:00
Pack MachineInstr fields better.
This shrinks MachineInstr to 64 bytes (from 72). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
111e5fe7e0
commit
b2c79f2f63
@ -87,7 +87,7 @@ private:
|
||||
// anything other than to convey comment
|
||||
// information to AsmPrinter.
|
||||
|
||||
uint16_t NumMemRefs; // information on memory references
|
||||
uint8_t NumMemRefs; // Information on memory references.
|
||||
mmo_iterator MemRefs;
|
||||
|
||||
DebugLoc debugLoc; // Source line information.
|
||||
@ -993,7 +993,8 @@ public:
|
||||
/// list. This does not transfer ownership.
|
||||
void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd) {
|
||||
MemRefs = NewMemRefs;
|
||||
NumMemRefs = NewMemRefsEnd - NewMemRefs;
|
||||
NumMemRefs = uint8_t(NewMemRefsEnd - NewMemRefs);
|
||||
assert(NumMemRefs == NewMemRefsEnd - NewMemRefs && "Too many memrefs");
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -741,16 +741,14 @@ void MachineInstr::RemoveOperand(unsigned OpNo) {
|
||||
void MachineInstr::addMemOperand(MachineFunction &MF,
|
||||
MachineMemOperand *MO) {
|
||||
mmo_iterator OldMemRefs = MemRefs;
|
||||
uint16_t OldNumMemRefs = NumMemRefs;
|
||||
unsigned OldNumMemRefs = NumMemRefs;
|
||||
|
||||
uint16_t NewNum = NumMemRefs + 1;
|
||||
unsigned NewNum = NumMemRefs + 1;
|
||||
mmo_iterator NewMemRefs = MF.allocateMemRefsArray(NewNum);
|
||||
|
||||
std::copy(OldMemRefs, OldMemRefs + OldNumMemRefs, NewMemRefs);
|
||||
NewMemRefs[NewNum - 1] = MO;
|
||||
|
||||
MemRefs = NewMemRefs;
|
||||
NumMemRefs = NewNum;
|
||||
setMemRefs(NewMemRefs, NewMemRefs + NewNum);
|
||||
}
|
||||
|
||||
bool MachineInstr::hasPropertyInBundle(unsigned Mask, QueryType Type) const {
|
||||
|
Loading…
Reference in New Issue
Block a user