You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Slow compilation when inlining code without debug infos #3130
For some 4 MB generated HLSL code (which I'm not allowed to share :( ), involving quite a deep call graph with lots of calls, the compilation with the DirectXShaderCompiler (commit e3a8344) is very slow.
Using the profiler of Visual Studio on a RelWithDebInfo build of dxc with "-T lib_6_5 " as command line, I got this result (aborting after two minutes of compilation):
When a call is inlined in llvm::InlineFunction(), the inliner tries to update the line number information using fixupLineNumbers().
If the call itself doesn't have a debug location, it looks up the debug information for the function containing the inlined call with getDISubprogram().
if (DISubprogram *Subprogram = getDISubprogram(Fn)) {
This function iterates over all instructions of the function until it finds debug information or the end of the function.
When we compile without debug information, have a lot of functions to inline and produce more and more code by all the inlining, this takes quite a significant amount of time, without adding anything to the result, as there is no debug info to be found.
Also the assumption in the comment in fixupLineNumbers() is wrong, that the inlined calls are from global variable initialization. These are normal functions calls.
Calling getDISubprogram() was introduced with 3811872.
Activity
Avoid trying to get disubprogram without debug MD
Avoid trying to get disubprogram without debug MD (#3488)
pow2clk commentedon Feb 23, 2021
Hi mkroll-nv!
The submitted fix is just a bit speculative, so I'd appreciate confirmation that it resolves your issue.
Bump urllib3 from 2.0.7 to 2.2.2 in /utils/git (#6699)
Bump urllib3 from 2.0.7 to 2.2.2 in /utils/git (microsoft#6699)