diff options
author | Eric Christopher <echristo@gmail.com> | 2014-06-27 02:05:19 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-06-27 02:05:19 +0000 |
commit | d8132862a9d037fc8448413c32eaaecad5bbcfc3 (patch) | |
tree | 14163e7fd6c61d2cf3091dbf402765559a588f0d /llvm/lib | |
parent | 1a5a520d9555680898b6112bf6a601ceb85c300d (diff) | |
download | bcm5719-llvm-d8132862a9d037fc8448413c32eaaecad5bbcfc3.tar.gz bcm5719-llvm-d8132862a9d037fc8448413c32eaaecad5bbcfc3.zip |
Rework the logic for setting the TargetName. This appears to
be shorter and identical in goal.
llvm-svn: 211845
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp b/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp index 8c7df52be34..2d2a88ab28a 100644 --- a/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp @@ -37,18 +37,12 @@ NVPTXSubtarget::NVPTXSubtarget(const std::string &TT, const std::string &CPU, else drvInterface = NVPTX::CUDA; - // Provide the default CPU if none - std::string defCPU = "sm_20"; - - ParseSubtargetFeatures((CPU.empty() ? defCPU : CPU), FS); - - // Get the TargetName from the FS if available - if (FS.empty() && CPU.empty()) - TargetName = defCPU; - else if (!CPU.empty()) - TargetName = CPU; - else + // Provide the default CPU if we don't have one. + if (CPU.empty() && FS.size()) llvm_unreachable("we are not using FeatureStr"); + TargetName = CPU.empty() ? "sm_20" : CPU; + + ParseSubtargetFeatures(TargetName, FS); // We default to PTX 3.1, but we cannot just default to it in the initializer // since the attribute parser checks if the given option is >= the default. |