[LLVMdev] Dragonegg + IR + llc = Dragonegg directly

Duncan Sands baldrick at free.fr
Tue Apr 17 06:12:10 PDT 2012


Hi Martin,

> I tried using dragonegg to compile some numerical software of ours. I
> tried out two different approaches expecting both would yield the same
> results:
> 1. gfortran-4.6 -fplugin=dragonegg-3.0 -o test.o test.f   (I ommitted a
> bunch of additional arguments for brevity)
> 2. gfortran-4.6 -fplugin=dragonegg-3.0 -fplugin-arg-dragonegg-emit-ir -S
> -o test.ll test.f
>     llc -O0 -o test.s test.ll
>     as -o test.o test.s
>
> When comparing the results of our software compiled with gfortran-4.6
> without LLVM with approach 1, I get the same results for both versions.
> However, when I use approach 2, the computation results differ from the
> original version.
>
> I expected that using the dragonegg plugin to generate native code
> directly would internally do more or less the same as the explicit step of
> approach 2, but this does not seem to be the case. Any ideas why this
> happens?

different arguments are being passed to the code generators.  In the
CreateTargetMachine function in Backend.cpp options like -fPIC,
-fomit-frame-pointer and so on are transformed into LLVM languages
and passed to the code generators.  Same goes for feature strings
(whether you are targeting a machine supporting SSE and so on).  A
few more generic codegen options are set in ConfigureLLVM.

Ciao, Duncan.



More information about the llvm-dev mailing list