From 49fb2e23bb3c932389f23fdda33a32d034ca9a0c Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 21 Dec 2022 11:47:48 -0600 Subject: Support `ref.test null` (#5368) This new variant of ref.test returns 1 if the input is null. --- src/passes/GUFA.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/passes/GUFA.cpp') diff --git a/src/passes/GUFA.cpp b/src/passes/GUFA.cpp index 4250c76e9..137ffda17 100644 --- a/src/passes/GUFA.cpp +++ b/src/passes/GUFA.cpp @@ -237,10 +237,8 @@ struct GUFAOptimizer if (refType.isRef()) { // We have some knowledge of the type here. Use that to optimize: RefTest // returns 1 if the input is of a subtype of the intended type, that is, - // we are looking for a type in that cone of types. (Note that we use a - // non-nullable cone since only a non-null can pass the test.) - auto intendedContents = - PossibleContents::fullConeType(Type(curr->intendedType, NonNullable)); + // we are looking for a type in that cone of types. + auto intendedContents = PossibleContents::fullConeType(curr->castType); auto optimize = [&](int32_t result) { auto* last = Builder(*getModule()).makeConst(Literal(int32_t(result))); -- cgit v1.2.3