aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCRegisterInfo.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-03-31 14:43:31 +0000
committerHal Finkel <hfinkel@anl.gov>2013-03-31 14:43:31 +0000
commit4345e8040f14781d20fd5fa2f7ee3c75fa611fa1 (patch)
tree1d92729c7389cb9f85bf1157b01a2e68bd5201c0 /lib/Target/PowerPC/PPCRegisterInfo.cpp
parentb8f0d89d0584e37e205c04ed5753f57a23365403 (diff)
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
Diffstat (limited to 'lib/Target/PowerPC/PPCRegisterInfo.cpp')
-rw-r--r--lib/Target/PowerPC/PPCRegisterInfo.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp
index 67cf13603b..c323186876 100644
--- a/lib/Target/PowerPC/PPCRegisterInfo.cpp
+++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp
@@ -526,24 +526,10 @@ PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
break;
}
- bool noImmForm = false;
- switch (OpC) {
- case PPC::LFIWAX:
- case PPC::LVEBX:
- 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;
- }
+ // If the instruction is not present in ImmToIdxMap, then it has no immediate
+ // form (and must be r+r).
+ bool noImmForm = !MI.isInlineAsm() &&
+ (ImmToIdxMap.find(OpC) == ImmToIdxMap.end());
// Now add the frame object offset to the offset from r1.
int Offset = MFI->getObjectOffset(FrameIndex);