qbe

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

ldhoist.ssa (288B)


      1 # loads must not be unsafely hoisted
      2 
      3 export
      4 function w $f(w %n, l %p) {
      5 @start
      6 	%r =w copy 0
      7 @loop
      8 	%n =w sub %n, 1
      9 	%c =w csgew %n, 0
     10 	jnz %c, @loop1, @end
     11 @loop1
     12 	%r =w loadw %p
     13 	jmp @loop
     14 @end
     15 	ret %r
     16 }
     17 
     18 # >>> driver
     19 # extern int f(int, int *);
     20 # int main() { return f(0, 0); }
     21 # <<<