The VCG output

Usage of VEX tools

The VCG output

Postby Alex Susu » Fri Mar 18, 2005 12:50 am

Hello!

In the help returned by the cc comand it is specified the following:
-fdraw-cfg=[0-3] Emit VCG control-flow graph
0: before phase 2
1: after phase 2
2: before phase 3
3: after phase 3.

Could you please tell me what do phases 2 and 3 stand for?

Could you please explain the VCG output of the `cc -fdraw-cfg` command?
Below is a VCG output:

Flow graph (pre-phase2):

Entry bblocks: 0(interpolate_x)

BBLOCK 0:
label 0:
follow: NULL
(an entry bblock)
preds:
succs: 1
stats:
136 ENTRY.NV.ARGS_REGS.ENT_LOCAL 123 1(I1) 0 [] 4 [I32,I32,SI32,SI32] [1,2,3,4] [dst?1.1,src?1.1,in_width?1.1,scale?1.1] interpolate_x
0 SLOAD.NV.ND.SI32 126 1(I1) t0 scale?1.1
1 SSTORE.NV.SI32 126 1(I1) t0 num?1.2
2 SSTORE.NV.SI32 127 1(I1) 1(SI32) den?1.2
3 SLOAD.NV.ND.SI32 128 1(I1) t1 scale?1.1
4 SLOAD.NV.ND.SI32 128 1(I1) t2 in_width?1.1
5 GIMUL.NV.SI32 128 1(I1) t3 2 [t1,t2]
[...]

BBLOCK 1:
label 0:
follow: NULL
preds: 0 5
succs: 3 2
stats:
28 LOOP_BEGIN.NV 138 1(I1) 100 0 4 1 -1 -1 F
29 SLOAD.NV.ND.SI32 138 1(I1) t18 i?1.2
30 SLOAD.NV.ND.SI32 138 1(I1) t19 out_width?1.2
31 IF_REL.NV.LT.SI32 138 1(I1) 0.5 t18 t19

BBLOCK 2:
label 0:
follow: NULL
preds: 1
succs:
stats:
137 RET.NV 172 1(I1) 0 [] [] [] 0 [] 0 []
...

Thank you.
Alex
Alex Susu
 

Postby frb » Fri Mar 18, 2005 6:14 pm

Phase2 and Phase3 refer to internal compiler phases. Roughly speaking, Phase2 is the machine-independent "high-level optimizer", and Phase3 is the machine-dependent scheduler. Depending on what you select, you get the output before of after these stages.

The "draw-cfg" flags produces two outputs: what you see on stderr (or whatever you set -mGLOB_info_output to be) and a GRAPH<function>.vcg file in the same directory where the compiler is invoked. For example, for a "main" routing, you'll find a GRAPHmain.vcg file, that can be visualized with xvcg.

-- Paolo
frb
 
Posts: 62
Joined: Thu Nov 12, 2009 3:44 pm


Return to VEX Tools



Who is online

Users browsing this forum: No registered users and 7 guests