mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Limit the number of memory operands in MachineInstr to 2^16 and store the number in padding.
Saves one machine word on MachineInstr (88->80 bytes on x86_64, 48->44 on i386). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152930 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -74,9 +74,10 @@ private:
|
||||
// anything other than to convey comment
|
||||
// information to AsmPrinter.
|
||||
|
||||
uint16_t NumMemRefs; // information on memory references
|
||||
mmo_iterator MemRefs;
|
||||
|
||||
std::vector<MachineOperand> Operands; // the operands
|
||||
mmo_iterator MemRefs; // information on memory references
|
||||
mmo_iterator MemRefsEnd;
|
||||
MachineBasicBlock *Parent; // Pointer to the owning basic block.
|
||||
DebugLoc debugLoc; // Source line information.
|
||||
|
||||
@@ -284,13 +285,13 @@ public:
|
||||
|
||||
/// Access to memory operands of the instruction
|
||||
mmo_iterator memoperands_begin() const { return MemRefs; }
|
||||
mmo_iterator memoperands_end() const { return MemRefsEnd; }
|
||||
bool memoperands_empty() const { return MemRefsEnd == MemRefs; }
|
||||
mmo_iterator memoperands_end() const { return MemRefs + NumMemRefs; }
|
||||
bool memoperands_empty() const { return NumMemRefs == 0; }
|
||||
|
||||
/// hasOneMemOperand - Return true if this instruction has exactly one
|
||||
/// MachineMemOperand.
|
||||
bool hasOneMemOperand() const {
|
||||
return MemRefsEnd - MemRefs == 1;
|
||||
return NumMemRefs == 1;
|
||||
}
|
||||
|
||||
/// API for querying MachineInstr properties. They are the same as MCInstrDesc
|
||||
@@ -888,7 +889,7 @@ public:
|
||||
/// list. This does not transfer ownership.
|
||||
void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd) {
|
||||
MemRefs = NewMemRefs;
|
||||
MemRefsEnd = NewMemRefsEnd;
|
||||
NumMemRefs = NewMemRefsEnd - NewMemRefs;
|
||||
}
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user