[llvm] r300394 - Tidy checking for the soft float attribute.
Eric Christopher via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 14 23:14:52 PDT 2017
Author: echristo
Date: Sat Apr 15 01:14:52 2017
New Revision: 300394
URL: http://llvm.org/viewvc/llvm-project?rev=300394&view=rev
Log:
Tidy checking for the soft float attribute.
Modified:
llvm/trunk/lib/Analysis/InlineCost.cpp
Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=300394&r1=300393&r2=300394&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
+++ llvm/trunk/lib/Analysis/InlineCost.cpp Sat Apr 15 01:14:52 2017
@@ -1101,19 +1101,10 @@ bool CallAnalyzer::analyzeBlock(BasicBlo
// is expensive or the function has the "use-soft-float" attribute, this may
// eventually become a library call. Treat the cost as such.
if (I->getType()->isFloatingPointTy()) {
- bool hasSoftFloatAttr = false;
-
// If the function has the "use-soft-float" attribute, mark it as
// expensive.
- if (F.hasFnAttribute("use-soft-float")) {
- Attribute Attr = F.getFnAttribute("use-soft-float");
- StringRef Val = Attr.getValueAsString();
- if (Val == "true")
- hasSoftFloatAttr = true;
- }
-
if (TTI.getFPOpCost(I->getType()) == TargetTransformInfo::TCC_Expensive ||
- hasSoftFloatAttr)
+ (F.getFnAttribute("use-soft-float").getValueAsString() == "true"))
Cost += InlineConstants::CallPenalty;
}
More information about the llvm-commits
mailing list