-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix correctness issues in sizeof tfunc (#36727)
The `Core.sizeof` function can take either a value or a type, which can be a bit confusing in the tfunc, because the tfunc operates on the types of the values passed to the builtin. In particular, we were incorrectly returning Const(16) (on 64bit) for sizeof_tfunc(UnionAll), because it was treating it the asme as `sizeof_tfunc(Const(UnionAll))`. Try to clean that up as well as fixing a similar confusion in the nothrow version of this function. Lastly, we had a similar fast path in codegen, which would try to inline the actual size for a constant datatype argument. For codegen, just rm that whole code path, since it should have no more information than inference and figuring it out in inference exposes strictly more optimization opportunities. Fixes #36710
- Loading branch information
Showing
5 changed files
with
79 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters