diff options
author | Victor Huang <wei.huang@ibm.com> | 2020-02-12 09:22:36 -0600 |
---|---|---|
committer | Victor Huang <wei.huang@ibm.com> | 2020-02-12 09:23:11 -0600 |
commit | caa10988bef0aaade99eda72b10e5a9f711ab170 (patch) | |
tree | 67e0b9f286516287d546c0bffe960f4604363e40 /llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp | |
parent | b5abd50f06966af28df4f80850f006c9cda7a07e (diff) | |
download | llvm-caa10988bef0aaade99eda72b10e5a9f711ab170.zip llvm-caa10988bef0aaade99eda72b10e5a9f711ab170.tar.gz llvm-caa10988bef0aaade99eda72b10e5a9f711ab170.tar.bz2 |
[PowerPC] Add options for PPC to enable/disable using non-volatile CR
An option is added for PowerPC to disable use of non-volatile CR
register fields and avoid CR spilling in the prologue.
Differential Revision: https://reviews.llvm.org/D69835
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp b/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp index 2f65d6a..dfc1ec0 100644 --- a/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp @@ -10,10 +10,17 @@ #include "llvm/ADT/Twine.h" #include "llvm/IR/DataLayout.h" #include "llvm/MC/MCContext.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +static cl::opt<bool> PPCDisableNonVolatileCR( + "ppc-disable-non-volatile-cr", + cl::desc("Disable the use of non-volatile CR register fields"), + cl::init(false), cl::Hidden); void PPCFunctionInfo::anchor() {} +PPCFunctionInfo::PPCFunctionInfo(MachineFunction &MF) + : DisableNonVolatileCR(PPCDisableNonVolatileCR), MF(MF) {} MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const { const DataLayout &DL = MF.getDataLayout(); |