summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-03-31 12:11:33 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-03-31 12:11:33 +0000
commit41f32c71273156391eb0855bf78b5ea533dd0ac0 (patch)
tree230fc8a1cf741bbda7f39d6a237804d36edf9877 /llvm/lib/CodeGen
parentbe209ab8a21b70795630ff162a2daeaccca96e34 (diff)
downloadbcm5719-llvm-41f32c71273156391eb0855bf78b5ea533dd0ac0.tar.gz
bcm5719-llvm-41f32c71273156391eb0855bf78b5ea533dd0ac0.zip
lib/CodeGen/LiveIntervalAnalysis.cpp: [PR9590] Don't use std::pow(float,float) here.
We don't expect the real "powf()" on some hosts (and powf() would be available on other hosts). For consistency, std::pow(double,double) may be called instead. Or, precision issue might attack us, to see unstable regalloc and stack coloring. llvm-svn: 128629
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index d1de6a85398..68bd0a60c98 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1715,7 +1715,9 @@ LiveIntervals::getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
// overflow a float. This expression behaves like 10^d for small d, but is
// more tempered for large d. At d=200 we get 6.7e33 which leaves a bit of
// headroom before overflow.
- float lc = std::pow(1 + (100.0f / (loopDepth+10)), (float)loopDepth);
+ // By the way, powf() might be unavailable here. For consistency,
+ // We may take pow(double,double).
+ float lc = std::pow(1 + (100.0 / (loopDepth + 10)), (double)loopDepth);
return (isDef + isUse) * lc;
}
OpenPOWER on IntegriCloud