Provide better -O0 assembly on request

Sergey Dmitrouk sdmitrouk at accesssoftek.com
Mon May 18 14:08:00 PDT 2015


> Having a debug mode that changes the object code is a pretty hard line we
> haven't crossed yet. There's been some mention of -Og which would optimize
> for debuggability, which would be totally fine to affect codegen, but I
> don't know if this change would fit there either.

Yeah, -Og is somewhere between -O0 and other levels, not sure it should
be more debuggable than -O0.

> It'd be best to try to find a solution that doesn't adversely affect code
> generation. Paul's suggestion (or something that produces the equivalent
> behavior - essentially attribute the constant manifesting instructions to
> whatever the first debug-located instruction is in the basic block) is one
> option. Another would be to change the way these constants are emitted,
> sinking them down at least to their first use, and attributing them to
> that use. I haven't looked at the code enough to know how this would
> work/be implemented.

Solution that doesn't affect code generation a lot is fine with me, just was
curious if anyone is interested in -O0 assembly with less optimizations.
Second option sounds like a better approach than block post-processing
to fixup initial location, for now I don't see why it won't work, but need
to actually try this.  Thanks!

-- 
Sergey



More information about the llvm-commits mailing list