Skip to content

Fix TBAA for DataType#37184

Merged
yuyichao merged 1 commit intomasterfrom
yyc/codegen/datatype
Aug 28, 2020
Merged

Fix TBAA for DataType#37184
yuyichao merged 1 commit intomasterfrom
yyc/codegen/datatype

Conversation

@yuyichao
Copy link
Contributor

Due to lazy field type initialization, the types field is actually mutable in DataType.
This means that we cannot use immutable or constant TBAA for all DataType fields.

However, since any objects stored in the field are still rooted
over the lifetime of the DataType we can still let the GC root placement pass refine
any field to the parent DataType.
Also make use of the field offset to still mark known load from all other fields as constant.
This is currently done via a special case but it could also be useful for many other types too.


Ref #37044

Due to lazy field type initialization, the `types` field is actually mutable in `DataType`.
This means that we cannot use immutable or constant TBAA for all `DataType` fields.

However, since any objects stored in the field are still rooted
over the lifetime of the `DataType` we can still let the GC root placement pass refine
any field to the parent `DataType`.
Also make use of the field offset to still mark known load from all other fields as constant.
This is currently done via a special case but it could also be useful for many other types too.
@yuyichao yuyichao merged commit 80e69b9 into master Aug 28, 2020
@yuyichao yuyichao deleted the yyc/codegen/datatype branch August 28, 2020 13:15
oscardssmith pushed a commit to oscardssmith/julia that referenced this pull request Aug 28, 2020
Due to lazy field type initialization, the `types` field is actually mutable in `DataType`.
This means that we cannot use immutable or constant TBAA for all `DataType` fields.

However, since any objects stored in the field are still rooted
over the lifetime of the `DataType` we can still let the GC root placement pass refine
any field to the parent `DataType`.
Also make use of the field offset to still mark known load from all other fields as constant.
This is currently done via a special case but it could also be useful for many other types too.
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 29, 2020
Due to lazy field type initialization, the `types` field is actually mutable in `DataType`.
This means that we cannot use immutable or constant TBAA for all `DataType` fields.

However, since any objects stored in the field are still rooted
over the lifetime of the `DataType` we can still let the GC root placement pass refine
any field to the parent `DataType`.
Also make use of the field offset to still mark known load from all other fields as constant.
This is currently done via a special case but it could also be useful for many other types too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant