qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

_alt.ssa (529B)


      1 # an example with reducible control
      2 # flow graph that exposes poor
      3 # handling of looping constructs
      4 
      5 function $test() {
      6 @start
      7 	%ten =w copy 10
      8 	%dum =w copy 0  # dummy live-through temporary
      9 @loop
     10 	%alt =w phi @start 0, @left %alt1, @right %alt1
     11 	%cnt =w phi @start 100, @left %cnt, @right %cnt1
     12 	%alt1 =w sub 1, %alt
     13 	jnz %alt1, @right, @left
     14 @left
     15 	%x =w phi @loop 10, @left %x1
     16 	%x1 =w sub %x, 1
     17 	%z =w copy %x
     18 	jnz %z, @left, @loop
     19 @right
     20 	%cnt1 =w sub %cnt, %ten
     21 	jnz %cnt1, @loop, @end
     22 @end
     23 	%ret =w add %cnt, %dum
     24 	ret
     25 }