[llvm-commits] [llvm] r111860 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Eric Christopher
echristo at apple.com
Mon Aug 23 16:14:31 PDT 2010
Author: echristo
Date: Mon Aug 23 18:14:31 2010
New Revision: 111860
URL: http://llvm.org/viewvc/llvm-project?rev=111860&view=rev
Log:
Add some more "get address into register" code and a more TODOs/FIXMEs.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=111860&r1=111859&r2=111860&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Aug 23 18:14:31 2010
@@ -361,10 +361,32 @@
unsigned Reg;
int Offset;
+ // TODO: Think about using loadRegFromStackSlot() here when we can.
+
// See if we can handle this as Reg + Offset
if (!ARMComputeRegOffset(I, Reg, Offset))
return false;
+ // Since the offset may be too large for the load instruction
+ // get the reg+offset into a register.
+ // TODO: Optimize this somewhat.
+ // FIXME: There is more than one register class in the world...
+ unsigned ScratchReg
+ = FuncInfo.MF->getRegInfo().createVirtualRegister(ARM::GPRRegisterClass);
+ ARMCC::CondCodes Pred = ARMCC::AL;
+ unsigned PredReg = 0;
+
+ if (!AFI->isThumbFunction())
+ emitARMRegPlusImmediate(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
+ ScratchReg, Reg, Offset, Pred, PredReg,
+ static_cast<const ARMBaseInstrInfo&>(TII));
+ else {
+ assert(AFI->isThumb2Function());
+ emitT2RegPlusImmediate(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
+ ScratchReg, Reg, Offset, Pred, PredReg,
+ static_cast<const ARMBaseInstrInfo&>(TII));
+ }
+
unsigned ResultReg = createResultReg(ARM::GPRRegisterClass);
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(ARM::LDR), ResultReg)
More information about the llvm-commits
mailing list