diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-03-31 12:11:33 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-03-31 12:11:33 +0000 |
commit | dc5198bac7e3f9b61617c8c46a1c28a84daa9325 (patch) | |
tree | 95cef8cf80b05c3e69056ff37bcb84bde3d9cd54 | |
parent | 00e00d693c3991d85ffebf305ddbfd5dfb99ead6 (diff) | |
download | external_llvm-dc5198bac7e3f9b61617c8c46a1c28a84daa9325.zip external_llvm-dc5198bac7e3f9b61617c8c46a1c28a84daa9325.tar.gz external_llvm-dc5198bac7e3f9b61617c8c46a1c28a84daa9325.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128629 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index d1de6a8..68bd0a6 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/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; } |