Use the appropriate register class for an i32 when adding ARM::LR to the
authorJim Grosbach <grosbach@apple.com>
Fri, 23 Jul 2010 23:50:35 +0000 (23:50 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 23 Jul 2010 23:50:35 +0000 (23:50 +0000)
function live in set. This will give us tGPR for Thumb1 and GPR otherwise,
so the copy will be spillable. rdar://8224931

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109293 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMISelLowering.cpp

index 1f9908c6f6c1343a71aed2467c2fb198fc08b799..35ca389bf338af0152b5b5823652153e5d79e27b 100644 (file)
@@ -2608,7 +2608,7 @@ SDValue ARMTargetLowering::LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const{
   }
 
   // Return LR, which contains the return address. Mark it an implicit live-in.
-  unsigned Reg = MF.addLiveIn(ARM::LR, ARM::GPRRegisterClass); 
+  unsigned Reg = MF.addLiveIn(ARM::LR, getRegClassFor(MVT::i32));
   return DAG.getCopyFromReg(DAG.getEntryNode(), dl, Reg, VT);
 }