[llvm-dev] Uncovering non-determinism in LLVM - The Next Steps

Robinson, Paul via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 6 09:12:17 PDT 2017

> Out of curiosity
> what kinds of changes arise from the presence/absence of -g? (It's not
> just the expected presence/absence of the debug info?)

Adding -g does have codegen effects, the most common reason being 
that it adds IR instructions, some of which have uses of variables,
and sometimes passes don't ignore those things properly.  I think 
all the really egregious cases have been fixed by now (at one point 
they were counted in inlining costs, which meant that -g affected 
inlining decisions!), but we see it now and again.

There can also be minor instruction-ordering effects because -g wants 
to emit unwind info, which appears in the form of assembler .cfi_* 
directives, and those appear to be instruction-ordering barriers.
That's the one that pops to mind as something we haven't tried to fix.

There might be others, I haven't looked at that stuff lately.

More information about the llvm-dev mailing list