diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-05-15 17:10:24 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-05-15 17:10:24 +0000 |
| commit | 93cd0f1c890846012c88a9fce471daa191b68a41 (patch) | |
| tree | 50927d66888521ec18c8b973228632c41e52403b /llvm/lib/CodeGen | |
| parent | b0efad148c12994ae139da0269ee5653bf736c63 (diff) | |
| download | bcm5719-llvm-93cd0f1c890846012c88a9fce471daa191b68a41.tar.gz bcm5719-llvm-93cd0f1c890846012c88a9fce471daa191b68a41.zip | |
improve portability to systems that don't have powf/modf (e.g. solaris 9)
patch by Evzen Muller!
llvm-svn: 103876
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocLinearScan.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocPBQP.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index aa0597f6876..99d94c30150 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1634,7 +1634,7 @@ 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 = powf(1 + (100.0f / (loopDepth+10)), (float)loopDepth); + float lc = std::pow(1 + (100.0f / (loopDepth+10)), (float)loopDepth); return (isDef + isUse) * lc; } diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp index 6c8fc0c2a32..bc331f0ff81 100644 --- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp +++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp @@ -809,7 +809,7 @@ float getConflictWeight(LiveInterval *cur, unsigned Reg, LiveIntervals *li_, MachineInstr *MI = &*I; if (cur->liveAt(li_->getInstructionIndex(MI))) { unsigned loopDepth = loopInfo->getLoopDepth(MI->getParent()); - Conflicts += powf(10.0f, (float)loopDepth); + Conflicts += std::pow(10.0f, (float)loopDepth); } } return Conflicts; diff --git a/llvm/lib/CodeGen/RegAllocPBQP.cpp b/llvm/lib/CodeGen/RegAllocPBQP.cpp index 81cfd8f0bbd..4fafd2818a1 100644 --- a/llvm/lib/CodeGen/RegAllocPBQP.cpp +++ b/llvm/lib/CodeGen/RegAllocPBQP.cpp @@ -489,7 +489,7 @@ PBQPRegAlloc::CoalesceMap PBQPRegAlloc::findCoalesces() { // did, but none of their definitions would prevent us from coalescing. // We're good to go with the coalesce. - float cBenefit = powf(10.0f, loopInfo->getLoopDepth(mbb)) / 5.0; + float cBenefit = std::pow(10.0f, (float)loopInfo->getLoopDepth(mbb)) / 5.0; coalescesFound[RegPair(srcReg, dstReg)] = cBenefit; coalescesFound[RegPair(dstReg, srcReg)] = cBenefit; |

