[LLVMdev] debug stoppoint nodes with -fast option

Dale Johannesen dalej at apple.com
Mon Apr 6 10:08:23 PDT 2009

On Apr 5, 2009, at 11:54 PMPDT, vasudev wrote:

> I need to generate line number debug information for PIC16 target.
> PIC16 does not support dwarf format. It supports coff format. So I  
> need
> to custom handle the STOPPOINT nodes. Without -fast option the  
> nodes are not created in dag because of the below check in
> SelectionDAGBuild.cpp
>     if (Fast)
>        DAG.setRoot(DAG.getDbgStopPoint(getRoot(),
> If I give -fast option then the Fast flag is true, but the dag doesn't
> contain STOPPOINT nodes.

Right.  Currently, the way we tell whether optimization was requested  
at the command line level is to look at -fast; -O0 == -fast.
The stoppoint nodes enforce an ordering of loads and stores  
corresponding to the original source, which means that putting them in  
without -fast would lead to codegen (scheduling) differences between - 
O and -O -g.  We don't want that.

Instead, the debug info is transferred at this point from stoppoint  
nodes to the DebugLoc field in each MachineInstr node.  You should  
probably use that.

(The current state of debug info with -O is that we think -g never  
affects codegen; violations of that should be reported as bugs.  The  
quality of the debug info has not been worked on much and is  

> If  I have simple loads and stores in source
> code, the dag doesn't contain them too. Why are these nodes not being
> created?

I don't know.  Something to do with your target, they appear for me.

More information about the llvm-dev mailing list