[LLVMdev] pb05 results for current llvm/dragonegg

Duncan Sands baldrick at free.fr
Fri Apr 6 05:06:36 PDT 2012


Hi Jack,

>                 dragonegg degg+vectorize degg+optnz  gfortran degg+novect+optnz degg+fullvect+optnz
> ac               12.45       12.45         8.85       8.80       8.90              10.89

for this one it looks like the major reason for the difference is that GCC turns
this floating point division:

       DATA d2/2147483647.D0/
...
       GGL = Ds/d2

into multiplication by the inverse (which is OK because of -ffast-math), however
LLVM does not.  This results in the following difference in the LLVM IR:

GCC optimizers:

   %3 = fmul double %2, 0x3E00000000200000

LLVM optimizers:

   %3 = fdiv double %2, 0x41DFFFFFFFC00000

The code generators don't help out even though they are passed
-enable-unsafe-fp-math (aka -ffast-math):

GCC optimizers + LLVM codegen:

         mulsd   .LCPI4_2(%rip), %xmm0

LLVM optimizers + LLVM codegen:

         divsd   .LCPI2_1(%rip), %xmm0

I'm surprised that the code generators didn't get this.

Ciao, Duncan.



More information about the llvm-dev mailing list