Skip to content

Commit 00407cf

Browse files
PR updates
1 parent 4a440f9 commit 00407cf

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/passes/GlobalEffects.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,10 @@ CallGraph buildCallGraph(const Module& module,
177177
for (HeapType type : allFunctionTypes) {
178178
// Not needed except that during lookup we expect the key to exist.
179179
callGraph[type];
180-
181-
for (auto super = type.getDeclaredSuperType(); super;
182-
super = super->getDeclaredSuperType()) {
183-
// Don't bother noting supertypes with no functions in it. There are no
184-
// effects to aggregate anyway.
185-
if (allFunctionTypes.contains(*super)) {
186-
callGraph[*super].insert(type);
187-
}
180+
for (HeapType curr = type;
181+
std::optional<HeapType> super = curr.getDeclaredSuperType();
182+
curr = *super) {
183+
callGraph[*super].insert(type);
188184
}
189185
}
190186

test/lit/passes/global-effects-closed-world.wast

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
;; CHECK-NEXT: )
5555
;; CHECK-NEXT: )
5656
(func $g (param $ref (ref null $nopType))
57-
;; Similar to $f, but we may still trap here because the ref is null.
57+
;; Similar to $f, but we may still trap here because the ref is null, so we
58+
;; don't optimize.
5859
(call $calls-nop-via-nullable-ref (local.get $ref))
5960
)
6061
)

0 commit comments

Comments
 (0)