[CodeGen] Simplify getRecipEstimateForFunc

It used two attribute lookups when only one was needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291965 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2017-01-13 22:24:25 +00:00
parent beabb639c5
commit 3615e56501

View File

@ -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.