mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +00:00
Cleanup ImmToIdxMap and noImmForm in PPCRegisterInfo
ImmToIdxMap should be a DenseMap (not a std::map) because there is no ordering requirement. Also, we don't need a separate list of instructions for noImmForm in eliminateFrameIndex, because this list is essentially the complement of the keys in ImmToIdxMap. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178450 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -526,24 +526,10 @@ PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool noImmForm = false;
|
// If the instruction is not present in ImmToIdxMap, then it has no immediate
|
||||||
switch (OpC) {
|
// form (and must be r+r).
|
||||||
case PPC::LFIWAX:
|
bool noImmForm = !MI.isInlineAsm() &&
|
||||||
case PPC::LVEBX:
|
(ImmToIdxMap.find(OpC) == ImmToIdxMap.end());
|
||||||
case PPC::LVEHX:
|
|
||||||
case PPC::LVEWX:
|
|
||||||
case PPC::LVX:
|
|
||||||
case PPC::LVXL:
|
|
||||||
case PPC::LVSL:
|
|
||||||
case PPC::LVSR:
|
|
||||||
case PPC::STVEBX:
|
|
||||||
case PPC::STVEHX:
|
|
||||||
case PPC::STVEWX:
|
|
||||||
case PPC::STVX:
|
|
||||||
case PPC::STVXL:
|
|
||||||
noImmForm = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now add the frame object offset to the offset from r1.
|
// Now add the frame object offset to the offset from r1.
|
||||||
int Offset = MFI->getObjectOffset(FrameIndex);
|
int Offset = MFI->getObjectOffset(FrameIndex);
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#ifndef POWERPC32_REGISTERINFO_H
|
#ifndef POWERPC32_REGISTERINFO_H
|
||||||
#define POWERPC32_REGISTERINFO_H
|
#define POWERPC32_REGISTERINFO_H
|
||||||
|
|
||||||
|
#include "llvm/ADT/DenseMap.h"
|
||||||
#include "PPC.h"
|
#include "PPC.h"
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#define GET_REGINFO_HEADER
|
#define GET_REGINFO_HEADER
|
||||||
#include "PPCGenRegisterInfo.inc"
|
#include "PPCGenRegisterInfo.inc"
|
||||||
@@ -27,7 +27,7 @@ class TargetInstrInfo;
|
|||||||
class Type;
|
class Type;
|
||||||
|
|
||||||
class PPCRegisterInfo : public PPCGenRegisterInfo {
|
class PPCRegisterInfo : public PPCGenRegisterInfo {
|
||||||
std::map<unsigned, unsigned> ImmToIdxMap;
|
DenseMap<unsigned, unsigned> ImmToIdxMap;
|
||||||
const PPCSubtarget &Subtarget;
|
const PPCSubtarget &Subtarget;
|
||||||
const TargetInstrInfo &TII;
|
const TargetInstrInfo &TII;
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user