From 1a2d26f4092897f88f8fc60fc7a4dee2083ae531 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 10 Sep 2024 15:24:16 -0700 Subject: Replace the old topological sort everywhere (#6902) To avoid having two separate topological sort utilities in the code base, replace remaining uses of the old DFS-based, CRTP topological sort with the newer Kahn's algorithm implementation. This would be NFC, except that the new topological sort produces a different order than the old topological sort, so the output of some passes is reordered. --- test/lit/ctor-eval/gc-cycle-multi.wast | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'test/lit/ctor-eval/gc-cycle-multi.wast') diff --git a/test/lit/ctor-eval/gc-cycle-multi.wast b/test/lit/ctor-eval/gc-cycle-multi.wast index 705b76f2f..070291432 100644 --- a/test/lit/ctor-eval/gc-cycle-multi.wast +++ b/test/lit/ctor-eval/gc-cycle-multi.wast @@ -13,27 +13,26 @@ ;; CHECK: (type $2 (func (result i32))) - ;; CHECK: (global $ctor-eval$global_8 (ref $A) (struct.new $A + ;; CHECK: (global $ctor-eval$global_6 (ref $A) (struct.new $A ;; CHECK-NEXT: (ref.null none) - ;; CHECK-NEXT: (i32.const 30) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: )) - ;; CHECK: (global $c (mut (ref null $A)) (global.get $ctor-eval$global_8)) - ;; CHECK: (global $ctor-eval$global_7 (ref $A) (struct.new $A ;; CHECK-NEXT: (ref.null none) - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (i32.const 20) ;; CHECK-NEXT: )) - ;; CHECK: (global $a (mut (ref null $A)) (global.get $ctor-eval$global_7)) - (global $a (mut (ref null $A)) (ref.null $A)) - ;; CHECK: (global $ctor-eval$global_6 (ref $A) (struct.new $A + ;; CHECK: (global $ctor-eval$global_8 (ref $A) (struct.new $A ;; CHECK-NEXT: (ref.null none) - ;; CHECK-NEXT: (i32.const 20) + ;; CHECK-NEXT: (i32.const 30) ;; CHECK-NEXT: )) - ;; CHECK: (global $b (mut (ref null $A)) (global.get $ctor-eval$global_6)) + ;; CHECK: (global $a (mut (ref null $A)) (global.get $ctor-eval$global_6)) + (global $a (mut (ref null $A)) (ref.null $A)) + ;; CHECK: (global $b (mut (ref null $A)) (global.get $ctor-eval$global_7)) (global $b (mut (ref null $A)) (ref.null $A)) + ;; CHECK: (global $c (mut (ref null $A)) (global.get $ctor-eval$global_8)) (global $c (mut (ref null $A)) (ref.null $A)) (func $makeCycle (param $i i32) (result (ref $A)) @@ -118,16 +117,16 @@ ) ;; CHECK: (func $start (type $1) ;; CHECK-NEXT: (struct.set $A 0 -;; CHECK-NEXT: (global.get $ctor-eval$global_8) -;; CHECK-NEXT: (global.get $ctor-eval$global_8) +;; CHECK-NEXT: (global.get $ctor-eval$global_6) +;; CHECK-NEXT: (global.get $ctor-eval$global_6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (struct.set $A 0 ;; CHECK-NEXT: (global.get $ctor-eval$global_7) ;; CHECK-NEXT: (global.get $ctor-eval$global_7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (struct.set $A 0 -;; CHECK-NEXT: (global.get $ctor-eval$global_6) -;; CHECK-NEXT: (global.get $ctor-eval$global_6) +;; CHECK-NEXT: (global.get $ctor-eval$global_8) +;; CHECK-NEXT: (global.get $ctor-eval$global_8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -- cgit v1.2.3