aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/PPCMachineFunctionInfo.h
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-10-24 21:24:23 +0000
committerDale Johannesen <dalej@apple.com>2008-10-24 21:24:23 +0000
commitc12e5812be4dacc30781db84b045775c46580240 (patch)
treeb32b8045f5f67d67b2beeae730b4c505f11c9d1f /lib/Target/PowerPC/PPCMachineFunctionInfo.h
parent47106ba6584230b99af2fd64378ea9f90c686eb2 (diff)
downloadexternal_llvm-c12e5812be4dacc30781db84b045775c46580240.zip
external_llvm-c12e5812be4dacc30781db84b045775c46580240.tar.gz
external_llvm-c12e5812be4dacc30781db84b045775c46580240.tar.bz2
Rewrite logic to figure out whether LR needs to
be saved/restored in the prolog/epilog. We need to do this iff something in the function stores into it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCMachineFunctionInfo.h')
-rw-r--r--lib/Target/PowerPC/PPCMachineFunctionInfo.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/Target/PowerPC/PPCMachineFunctionInfo.h b/lib/Target/PowerPC/PPCMachineFunctionInfo.h
index 230ea0b..42883d7 100644
--- a/lib/Target/PowerPC/PPCMachineFunctionInfo.h
+++ b/lib/Target/PowerPC/PPCMachineFunctionInfo.h
@@ -31,9 +31,10 @@ private:
///
int ReturnAddrSaveIndex;
- /// UsesLR - Indicates whether LR is used in the current function. This is
- /// only valid after the initial scan of the function by PEI.
- bool UsesLR;
+ /// MustSaveLR - Indicates whether LR is defined (or clobbered) in the current
+ /// function. This is only valid after the initial scan of the function by
+ /// PEI.
+ bool MustSaveLR;
/// SpillsCR - Indicates whether CR is spilled in the current function.
bool SpillsCR;
@@ -79,12 +80,13 @@ public:
int getTailCallSPDelta() const { return TailCallSPDelta; }
void setTailCallSPDelta(int size) { TailCallSPDelta = size; }
- /// UsesLR - This is set when the prolog/epilog inserter does its initial scan
- /// of the function, it is true if the LR/LR8 register is ever explicitly
- /// accessed/clobbered in the machine function (e.g. by calls and movpctolr,
- /// which is used in PIC generation).
- void setUsesLR(bool U) { UsesLR = U; }
- bool usesLR() const { return UsesLR; }
+ /// MustSaveLR - This is set when the prolog/epilog inserter does its initial
+ /// scan of the function. It is true if the LR/LR8 register is ever explicitly
+ /// defined/clobbered in the machine function (e.g. by calls and movpctolr,
+ /// which is used in PIC generation), or if the LR stack slot is explicitly
+ /// referenced by builtin_return_address.
+ void setMustSaveLR(bool U) { MustSaveLR = U; }
+ bool mustSaveLR() const { return MustSaveLR; }
void setSpillsCR() { SpillsCR = true; }
bool isCRSpilled() const { return SpillsCR; }