当我执行PGO优化步骤(使用LINK.EXE /LTCG:PGU)时,Visual Studio2010链接器报告:
Merging foo!1.pgc
'FOO_EDGE::get_input': Arc 2 --> 4 has negative count (-414343)
Expectation failed: f line 4241
'FOO_DELAY::set_delay': Block 18 outgoing counts differ from block count (-9 diff)
Expectation failed: f line 4261
Expectation failed: f line 4211
'FOO_DELAY::set_delay': Arc 12 --> 23 has negative count (-3)
Expectation failed: f line 4220
Generating code
907 of 4948 ( 18.33%) profiled functions will be compiled for speed
4948 of 4948 functions (100.0%) were optimized using profile data
42912225037 of 42912225037 instructions (100.0%) were optimized using profile data是什么导致了这些“期望失败”?我应该如何解决这些问题?似乎PGO仍在优化代码,但我对出现这些消息时优化的质量/完整性有点怀疑。
发布于 2013-01-30 07:13:55
这些错误似乎是在执行多线程应用程序的PGO检测运行时发生的。它们可以通过使用x64上的/PogoSafeMode标志进行编译(而不是链接)来避免。
我发现MSDN documentation on this flag并不是特别清楚;在多线程代码上执行PGO的正确过程是:
使用cl.exe /PogoSafeMode
link.exe /LTCG:PGI
link.exe /LTCG:PGO编译
https://stackoverflow.com/questions/14345715
复制相似问题