mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
Add a utility function to MachineInstr for testing whether an instruction
has exactly one MachineMemOperand, and change some X86 lowering code to make use of it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53498 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e6acf36dca
commit
cddc11e757
@ -115,6 +115,13 @@ public:
|
|||||||
{ return MemOperands.end(); }
|
{ return MemOperands.end(); }
|
||||||
bool memoperands_empty() const { return MemOperands.empty(); }
|
bool memoperands_empty() const { return MemOperands.empty(); }
|
||||||
|
|
||||||
|
/// hasOneMemOperand - Return true if this instruction has exactly one
|
||||||
|
/// MachineMemOperand.
|
||||||
|
bool hasOneMemOperand() const {
|
||||||
|
return !memoperands_empty() &&
|
||||||
|
next(memoperands_begin()) == memoperands_end();
|
||||||
|
}
|
||||||
|
|
||||||
/// isIdenticalTo - Return true if this instruction is identical to (same
|
/// isIdenticalTo - Return true if this instruction is identical to (same
|
||||||
/// opcode and same operands as) the specified instruction.
|
/// opcode and same operands as) the specified instruction.
|
||||||
bool isIdenticalTo(const MachineInstr *Other) const {
|
bool isIdenticalTo(const MachineInstr *Other) const {
|
||||||
|
@ -2030,14 +2030,10 @@ MachineInstr* X86InstrInfo::foldMemoryOperand(MachineFunction &MF,
|
|||||||
// Check switch flag
|
// Check switch flag
|
||||||
if (NoFusing) return NULL;
|
if (NoFusing) return NULL;
|
||||||
|
|
||||||
|
// Determine the alignment of the load.
|
||||||
unsigned Alignment = 0;
|
unsigned Alignment = 0;
|
||||||
for (alist<MachineMemOperand>::iterator i = LoadMI->memoperands_begin(),
|
if (LoadMI->hasOneMemOperand())
|
||||||
e = LoadMI->memoperands_end(); i != e; ++i) {
|
Alignment = LoadMI->memoperands_begin()->getAlignment();
|
||||||
const MachineMemOperand &MRO = *i;
|
|
||||||
unsigned Align = MRO.getAlignment();
|
|
||||||
if (Align > Alignment)
|
|
||||||
Alignment = Align;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: Move alignment requirement into tables?
|
// FIXME: Move alignment requirement into tables?
|
||||||
if (Alignment < 16) {
|
if (Alignment < 16) {
|
||||||
|
Loading…
Reference in New Issue
Block a user