[LLVMbugs] [Bug 9590] New: Host-dependent linearscan regalloc spiller
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Mar 30 04:20:42 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=9590
Summary: Host-dependent linearscan regalloc spiller
Product: libraries
Version: 2.9
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P
Component: Common Code Generator Code
AssignedTo: unassignedbugs at nondot.org
ReportedBy: geek4civic at gmail.com
CC: llvmbugs at cs.uiuc.edu
$ g++ --version
g++.exe (TDM-1 mingw32) 4.4.0
$ bin/clang++.exe --version
clang version 2.9 (git://github.com/chapuni/clang.git
http://llvm.org/git/clang.git
ssh://chapuni@192.168.1.193/home/chapuni/clang.git
b769bbbda7024bb990e8bad698e414b8e386ba5a)
Target: i686-pc-mingw32
Thread model: posix
--
With g++, std::pow(float,float) aka __builtin_powf() is expanded to pow().
With clang, std::pow(float,float) is still powf().
Due to precision issue, result of -regalloc=linearscan might not be identical.
(I have not tried other regallocs with clang)
Workaround is as below;
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1703,7 +1703,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 = std::pow(1 + (100.0f / (loopDepth+10)), (float)loopDepth);
+ float lc = ::pow(1 + (100.0f / (loopDepth+10)), (float)loopDepth);
return (isDef + isUse) * lc;
}
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list