File tree Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -112,15 +112,12 @@ struct AbstractTypeRefining : public Pass {
112
112
// module, given closed world, but we'd also need to make sure that
113
113
// we don't need to make any changes to public types that refer to
114
114
// them.
115
- // Similarly, treat all descriptor and described types as allocated because
116
- // we cannot yet optimize them correctly.
117
115
auto heapTypes = ModuleUtils::collectHeapTypeInfo (
118
116
*module ,
119
117
ModuleUtils::TypeInclusion::AllTypes,
120
118
ModuleUtils::VisibilityHandling::FindVisibility);
121
119
for (auto & [type, info] : heapTypes) {
122
- if (info.visibility == ModuleUtils::Visibility::Public ||
123
- type.getDescribedType () || type.getDescriptorType ()) {
120
+ if (info.visibility == ModuleUtils::Visibility::Public) {
124
121
createdTypes.insert (type);
125
122
}
126
123
}
Original file line number Diff line number Diff line change 38
38
)
39
39
)
40
40
)
41
+
42
+ (module
43
+ ;; Same as above, but now we should see references to $A.desc and $B.desc
44
+ ;; optimized to nullref because they are not instantiated. Similarly, $A is
45
+ ;; optimized to $B with TNH.
46
+ (rec
47
+ ;; YESTNH: (rec
48
+ ;; YESTNH-NEXT: (type $A (sub (descriptor $A.desc (struct (field (ref null $B)) (field (ref null $B))))))
49
+ ;; NO_TNH: (rec
50
+ ;; NO_TNH-NEXT: (type $A (sub (descriptor $A.desc (struct (field (ref null $A)) (field (ref null $B))))))
51
+ (type $A (sub (descriptor $A.desc (struct (field (ref null $A ) (ref null $B ))))))
52
+ ;; YESTNH: (type $A.desc (sub (describes $A (struct (field nullref) (field nullref)))))
53
+ ;; NO_TNH: (type $A.desc (sub (describes $A (struct (field nullref) (field nullref)))))
54
+ (type $A.desc (sub (describes $A (struct (field (ref null $A.desc ) (ref null $B.desc ))))))
55
+ ;; YESTNH: (type $B (sub $A (descriptor $B.desc (struct (field (ref null $B)) (field (ref null $B))))))
56
+ ;; NO_TNH: (type $B (sub $A (descriptor $B.desc (struct (field (ref null $A)) (field (ref null $B))))))
57
+ (type $B (sub $A (descriptor $B.desc (struct (field (ref null $A ) (ref null $B ))))))
58
+ ;; YESTNH: (type $B.desc (sub $A.desc (describes $B (struct (field nullref) (field nullref)))))
59
+ ;; NO_TNH: (type $B.desc (sub $A.desc (describes $B (struct (field nullref) (field nullref)))))
60
+ (type $B.desc (sub $A.desc (describes $B (struct (field (ref null $A.desc ) (ref null $B.desc ))))))
61
+ )
62
+
63
+ ;; YESTNH: (global $g (ref (exact $B)) (struct.new_default $B
64
+ ;; YESTNH-NEXT: (ref.null none)
65
+ ;; YESTNH-NEXT: ))
66
+ ;; NO_TNH: (global $g (ref (exact $B)) (struct.new_default $B
67
+ ;; NO_TNH-NEXT: (ref.null none)
68
+ ;; NO_TNH-NEXT: ))
69
+ (global $g (ref (exact $B ))
70
+ (struct.new_default $B
71
+ (ref.null none)
72
+ )
73
+ )
74
+ )
You can’t perform that action at this time.
0 commit comments