Microsoft Developer Network > Página principal de foros > Phoenix > there must be something wrong with my Phoenix!!!!!!!!!!!!!!!!!!
Formular una preguntaFormular una pregunta
 

Preguntathere must be something wrong with my Phoenix!!!!!!!!!!!!!!!!!!

  • miércoles, 28 de octubre de 2009 10:18John Connor Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    when i run the example "ipo-plug-in"; my cmdline is "cl -deplugin:ipo-plug-in.dll test.cpp"; but there must be something wrong with that , it output "C2 Pass 0 not found in passlist:"; but the "Phoenix Document" said that "the c2 compiler has two passes. The first pass performs necessary preparations before code generation, and the second pass does the actual code generation. " why ? is there something wrong wiht my phoenix? my phoenix's version is "Phoenix-SDK-June-2008-RC1". i changed the code ,i insert the C2Pass before "C2 Codegen Pass".but there is some other wrong,it output that "the callgraph is null". why ????? thanks !!!

Todas las respuestas

  • jueves, 29 de octubre de 2009 6:25Andy Ayers - MSFTModeradorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    The documentation left a few things out.

    We only run multiple passes when compiling via LTCG (link time code generation), and only build the call graph when optimization is enabled. Try adding -GL (for LTCG) and -O2 (for optimization) to your command line.
    Architect - Microsoft Phoenix Project
  • jueves, 29 de octubre de 2009 10:52John Connor Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    But which command line do you used when you run multiple passes.the "Documentation" said that the c2 compiler has two passes. how can i run multiple.  did it out???  the c2 pass 0 was used in that example "ipo-plug-in".    so i must run c2 compiler with multiple passes.

    thanks, i am here just because of you .

  • viernes, 30 de octubre de 2009 7:39Andy Ayers - MSFTModeradorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Mulitple passes will by run  by default whenever -GL is specified. To be specific, suppose your program code is in two source files, a1.cpp and c2.cpp.

    (1) You can allow cl.exe to invoke the linker for you, and add the plugin as an option via the PHX environment variable:

    [open up appropriate phx command shell]

    set PHX=-plugin:ipo-plug-in.dll
    cl -O2 -GL a1.cpp a2.cpp

    This will "compile" a1.cpp and a2.cpp, producing special a1.obj and a2.obj, and then invoke the linker to finish the job. The linker will load the Phoenix c2.dll, which in turn will load the plugin you specified. Since we have compiled the objects with -GL and -O2, the multiple passes will be run.

    or, (2) you can use cl to create object files and then have it stop, and then explicitly invoke the linker as a separate step:

    set PHX=-plugin:ipo-plug-in.dll
    cl -c -O2 -GL a1.cpp a2.cpp
    link -ltcg a1.obj a2.obj

    Form (2) is often convenient because the set of inputs to the linker makes up what we call a "link repro" and you can run this step over and over again without needing to recompile your source files, as you tinker with your plugin.

    I have a number of slides on this technique in the "Phoenix Summer Workshop" download that's available via connect.


    Architect - Microsoft Phoenix Project