[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


           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
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