[llvm-commits] [llvm] r76424 - /llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
David Goodwin
david_goodwin at apple.com
Mon Jul 20 08:55:49 PDT 2009
Author: david_goodwin
Date: Mon Jul 20 10:55:39 2009
New Revision: 76424
URL: http://llvm.org/viewvc/llvm-project?rev=76424&view=rev
Log:
Use t2LDRri12 for frame index loads.
Modified:
llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=76424&r1=76423&r2=76424&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon Jul 20 10:55:39 2009
@@ -596,8 +596,17 @@
bool ARMDAGToDAGISel::SelectT2AddrModeImm12(SDValue Op, SDValue N,
SDValue &Base, SDValue &OffImm) {
// Match simple R + imm12 operands.
- if (N.getOpcode() != ISD::ADD)
+
+ // Match frame index...
+ if (N.getOpcode() != ISD::ADD) {
+ if (N.getOpcode() == ISD::FrameIndex) {
+ int FI = cast<FrameIndexSDNode>(N)->getIndex();
+ Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
+ OffImm = CurDAG->getTargetConstant(0, MVT::i32);
+ return true;
+ }
return false;
+ }
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
int RHSC = (int)RHS->getZExtValue();
@@ -686,8 +695,7 @@
if (N.getOpcode() != ISD::ADD && N.getOpcode() != ISD::SUB) {
Base = N;
if (N.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(N)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
+ return false; // we want to select t2LDRri12 instead
} else if (N.getOpcode() == ARMISD::Wrapper) {
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::TargetConstantPool)
More information about the llvm-commits
mailing list