- In thumb mode, if size of MachineFunction is >= 2048, force LR to be
spilled (if it is not already).
- If LR is spilled, use BL to implement far jumps. LR is not used as a GPR
in thumb mode so it can be clobbered if it is properly spilled / restored
in prologue / epilogue.
- If LR is force spilled but no far jump has been emitted, try undo'ing the
spill by:
push lr -> delete
pop pc -> bx lr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33650 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMMachineFunctionInfo.h b/lib/Target/ARM/ARMMachineFunctionInfo.h
index 6ce4d53..6b3ac21 100644
--- a/lib/Target/ARM/ARMMachineFunctionInfo.h
+++ b/lib/Target/ARM/ARMMachineFunctionInfo.h
@@ -36,9 +36,9 @@
/// processFunctionBeforeCalleeSavedScan().
bool HasStackFrame;
- /// LRSpilled - True if the LR register has been spilled.
- ///
- bool LRSpilled;
+ /// LRSForceSpilled - True if the LR register has been for spilled to enable
+ /// far jump.
+ bool LRForceSpilled;
/// FramePtrSpillOffset - If HasStackFrame, this records the frame pointer
/// spill stack offset.
@@ -75,13 +75,13 @@
public:
ARMFunctionInfo() :
isThumb(false),
- VarArgsRegSaveSize(0), HasStackFrame(false), LRSpilled(false),
+ VarArgsRegSaveSize(0), HasStackFrame(false), LRForceSpilled(false),
FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0),
GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0) {}
ARMFunctionInfo(MachineFunction &MF) :
isThumb(MF.getTarget().getSubtarget<ARMSubtarget>().isThumb()),
- VarArgsRegSaveSize(0), HasStackFrame(false), LRSpilled(false),
+ VarArgsRegSaveSize(0), HasStackFrame(false), LRForceSpilled(false),
FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0),
GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0) {}
@@ -93,8 +93,8 @@
bool hasStackFrame() const { return HasStackFrame; }
void setHasStackFrame(bool s) { HasStackFrame = s; }
- bool isLRSpilled() const { return LRSpilled; }
- void setLRIsSpilled(bool s) { LRSpilled = s; }
+ bool isLRForceSpilled() const { return LRForceSpilled; }
+ void setLRIsForceSpilled(bool s) { LRForceSpilled = s; }
unsigned getFramePtrSpillOffset() const { return FramePtrSpillOffset; }
void setFramePtrSpillOffset(unsigned o) { FramePtrSpillOffset = o; }