summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2017-01-13 22:24:25 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2017-01-13 22:24:25 +0000
commite0ebdf4bc761a0e91cd651d48dcae4968ef65293 (patch)
tree4e00f01696cc2e789901d6ef6370d7a926c7f55a /llvm/lib/CodeGen/TargetLoweringBase.cpp
parent509bbd1a661637794ecab7178388831cd6e57810 (diff)
downloadbcm5719-llvm-e0ebdf4bc761a0e91cd651d48dcae4968ef65293.tar.gz
bcm5719-llvm-e0ebdf4bc761a0e91cd651d48dcae4968ef65293.zip
[CodeGen] Simplify getRecipEstimateForFunc
It used two attribute lookups when only one was needed. llvm-svn: 291965
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringBase.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 76b7852bcbc..f18cdca4861 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1918,11 +1918,7 @@ void TargetLoweringBase::setMaximumJumpTableSize(unsigned Val) {
/// override the target defaults.
static StringRef getRecipEstimateForFunc(MachineFunction &MF) {
const Function *F = MF.getFunction();
- StringRef RecipAttrName = "reciprocal-estimates";
- if (!F->hasFnAttribute(RecipAttrName))
- return StringRef();
-
- return F->getFnAttribute(RecipAttrName).getValueAsString();
+ return F->getFnAttribute("reciprocal-estimates").getValueAsString();
}
/// Construct a string for the given reciprocal operation of the given type.
OpenPOWER on IntegriCloud