summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCMachineFunctionInfo.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
commit044eb2f6afba375a914ac9d8024f8f5142bb912e (patch)
tree1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /lib/Target/PowerPC/PPCMachineFunctionInfo.h
parenteb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff)
Notes
Diffstat (limited to 'lib/Target/PowerPC/PPCMachineFunctionInfo.h')
-rw-r--r--lib/Target/PowerPC/PPCMachineFunctionInfo.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCMachineFunctionInfo.h b/lib/Target/PowerPC/PPCMachineFunctionInfo.h
index 202e10058b73..a9b6073106ea 100644
--- a/lib/Target/PowerPC/PPCMachineFunctionInfo.h
+++ b/lib/Target/PowerPC/PPCMachineFunctionInfo.h
@@ -16,6 +16,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/TargetCallingConv.h"
namespace llvm {
@@ -113,6 +114,10 @@ class PPCFunctionInfo : public MachineFunctionInfo {
/// copies
bool IsSplitCSR = false;
+ /// We keep track attributes for each live-in virtual registers
+ /// to use SExt/ZExt flags in later optimization.
+ std::vector<std::pair<unsigned, ISD::ArgFlagsTy>> LiveInAttrs;
+
public:
explicit PPCFunctionInfo(MachineFunction &MF) : MF(MF) {}
@@ -175,6 +180,19 @@ public:
unsigned getVarArgsNumFPR() const { return VarArgsNumFPR; }
void setVarArgsNumFPR(unsigned Num) { VarArgsNumFPR = Num; }
+ /// This function associates attributes for each live-in virtual register.
+ void addLiveInAttr(unsigned VReg, ISD::ArgFlagsTy Flags) {
+ LiveInAttrs.push_back(std::make_pair(VReg, Flags));
+ }
+
+ /// This function returns true if the spesified vreg is
+ /// a live-in register and sign-extended.
+ bool isLiveInSExt(unsigned VReg) const;
+
+ /// This function returns true if the spesified vreg is
+ /// a live-in register and zero-extended.
+ bool isLiveInZExt(unsigned VReg) const;
+
int getCRSpillFrameIndex() const { return CRSpillFrameIndex; }
void setCRSpillFrameIndex(int idx) { CRSpillFrameIndex = idx; }