diff options
author | Eric Christopher <echristo@gmail.com> | 2014-05-13 20:49:08 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-05-13 20:49:08 +0000 |
commit | d1309ee27df4cc82927939205f7629be77cfb10b (patch) | |
tree | 2fe35a03ed95cc620df195d50c52260128a4fa10 /llvm/lib/Target/PowerPC/PPCSubtarget.cpp | |
parent | 83fcaa8c666bc6fd91d255a54cc65782aeb15b8c (diff) | |
download | bcm5719-llvm-d1309ee27df4cc82927939205f7629be77cfb10b.tar.gz bcm5719-llvm-d1309ee27df4cc82927939205f7629be77cfb10b.zip |
Save the optimization level the subtarget was created with in a
member variable and sink the initialization of crbits into the
subtarget feature reset code.
No functional change, but this refactor will be used in a future
commit.
llvm-svn: 208726
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCSubtarget.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCSubtarget.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp index d02914cf37f..ea9daee4f8e 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp @@ -35,22 +35,10 @@ using namespace llvm; PPCSubtarget::PPCSubtarget(const std::string &TT, const std::string &CPU, const std::string &FS, bool is64Bit, CodeGenOpt::Level OptLevel) - : PPCGenSubtargetInfo(TT, CPU, FS) - , IsPPC64(is64Bit) - , TargetTriple(TT) { + : PPCGenSubtargetInfo(TT, CPU, FS), IsPPC64(is64Bit), TargetTriple(TT), + OptLevel(OptLevel) { initializeEnvironment(); - - std::string FullFS = FS; - - // At -O2 and above, track CR bits as individual registers. - if (OptLevel >= CodeGenOpt::Default) { - if (!FullFS.empty()) - FullFS = "+crbits," + FullFS; - else - FullFS = "+crbits"; - } - - resetSubtargetFeatures(CPU, FullFS); + resetSubtargetFeatures(CPU, FS); } /// SetJITMode - This is called to inform the subtarget info that we are @@ -140,6 +128,14 @@ void PPCSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) { FullFS = "+64bit"; } + // At -O2 and above, track CR bits as individual registers. + if (OptLevel >= CodeGenOpt::Default) { + if (!FullFS.empty()) + FullFS = "+crbits," + FullFS; + else + FullFS = "+crbits"; + } + // Parse features string. ParseSubtargetFeatures(CPUName, FullFS); |