diff options
author | Chris Lattner <sabre@nondot.org> | 2006-02-02 20:16:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-02-02 20:16:12 +0000 |
commit | c327d71e06a36c44903140a04ef580370669ec70 (patch) | |
tree | dae8b5ad85ad83444e998f56c278f6d68aaae7f2 /llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | bb53acd03cd54dd83027de5e7c8fcedd93ebb14f (diff) | |
download | bcm5719-llvm-c327d71e06a36c44903140a04ef580370669ec70.tar.gz bcm5719-llvm-c327d71e06a36c44903140a04ef580370669ec70.zip |
implement isStoreToStackSlot for PPC
llvm-svn: 25914
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp index 322d027504c..66251c0b232 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -95,8 +95,25 @@ unsigned PPCInstrInfo::isLoadFromStackSlot(MachineInstr *MI, break; } return 0; - } +} +unsigned PPCInstrInfo::isStoreToStackSlot(MachineInstr *MI, + int &FrameIndex) const { + switch (MI->getOpcode()) { + default: break; + //case PPC::ST: ? + case PPC::STW: + case PPC::STFS: + case PPC::STFD: + if (MI->getOperand(1).isImmediate() && !MI->getOperand(1).getImmedValue() && + MI->getOperand(2).isFrameIndex()) { + FrameIndex = MI->getOperand(2).getFrameIndex(); + return MI->getOperand(0).getReg(); + } + break; + } + return 0; +} // commuteInstruction - We can commute rlwimi instructions, but only if the // rotate amt is zero. We also have to munge the immediates a bit. |