gif up gif gif
Next: 4.4 Subroutine inlining Up: 4. Idiomatic Transformations Previous: 4.2 Loop distribution for

4.3 IF-conversion

 

IF-conversion is a transformation which converts control dependencies into data dependencies. Converted dependencies can then be resolved within the DU, rather than requiring CU intervention, and a probable LOD.

Several programs in the Perfect Club are amenable to this transformation. One program which benefits greatly from IF-conversion is MDG. An LOD reduction of 90% is achieved if this optimization is applied at line 1001 in routine INTERF, illustrated in figure 5, and at line 1208 in routine POTENG, illustrated in figure 6. All of the illustrations in this section were obtained directly from the experimental compiler.

  
Figure 5: An IF-convertible LOD in routine INTERF from MDG (click on image to view at full scale)

  
Figure 6: An IF-convertible LOD in routine POTENG from MDG (click on image to view at full scale)

Similarly, in SPEC77 a single LOD, accounting for 59% of all LODs in that program, can be eliminated by IF-conversion. The offending LOD is illustrated in figure 7. In this case the guarded code section is relatively large, and one might expect the compiler to be guided by profile information when deciding whether to apply IF-conversion in this case.

  
Figure 7: An IF-convertible LOD in routine LRGSCL from SPEC77 (click on image to view at full scale)

In BDNA IF-conversion again has a marked effect on overall performance. A single LOD, accounting for 48% of the LODs in BDNA, can be removed when IF-conversion is applied to the body of the loop at lines 3086-3088, as illustrated in figure 8. The remaining dominant LOD, at line 3065, then also goes away, as an indirect result of the modified code placement by the compiler.

  
Figure 8: Example of an algorithmic LOD in routine ACTFOR from BDNA.

Table 3 details the results of applying IF-conversion to the three programs (BDNA, MDG and SPEC77) which show significant benefit from that transformation.

 

  
Table 3: Optimized LOD frequencies after Hoisting and IF-conversion

The effect of IF-conversion on decoupling efficiency for the Perfect Club is illustrated graphically in figure 9.

  
Figure 9: Graph showing effect of IF-conversion on decoupling efficiency



gif up gif gif
Next: 4.4 Subroutine inlining Up: 4. Idiomatic Transformations Previous: 4.2 Loop distribution for



npt@dcs.ed.ac.uk